code: def wrapFunc(func, funcFlopCompute):
      oldFunc = func
      name = func.__name__
      old_functions[name] = oldFunc
  
      def newFunc(*args, **kwds):
          flops, macs = funcFlopCompute(*args, **kwds)
          if module_flop_count:
              module_flop_count[-1].append((name, flops))
          if module_mac_count and macs:
              module_mac_count[-1].append((name, macs))
          return oldFunc(*args, **kwds)
  
      newFunc.__name__ = func.__name__
  
      return newFunc
  
imports: import time
  import torch
  import torch.nn
  import torch.nn.functional
  from functools import partial
  from typing import List, Optional
  from collections import OrderedDict
  import numpy
label_desc: Use image node_id 28 for calling a global function with example usage: wrapFunc(func, funcFlopCompute) and returns: newFunc, oldFunc