class_docstr: Function profiler object.
  
  This is usually not directly used by users. It's created via
  :func:`profile`, and attached to a decorated
  function object as an attribute ``profiler``. See ``profile`` function for
  details.
code: def __call__(self, *args, **kw):
      if not self.condition(*args, **kw):
          return self.fn(*args, **kw)
      self.ncalls += 1
  
      if FunctionProfile.profiling:
          # Don't profile if Any other function is being profiled
          return self.fn(*args, **kw)
  
      profiler = self.profile_class()
  
      try:
          FunctionProfile.profiling = True
          return profiler.runcall(self.fn, *args, **kw)
      finally:
          FunctionProfile.profiling = False
          if self.stats is None:
              self.stats = pstats.Stats(profiler)
          else:
              self.stats.add(profiler)
          if self.print_freq and (self.ncalls % self.print_freq == 0):
              self.print_stats()
  
file_path: nnabla/python/src/nnabla/utils/function_profile.py
imports: import atexit
  import cProfile
  import pstats
label_desc: Use image node_id 2 for calling the FunctionProfile obj's underlying member method code with example usage: obj.__call__() and returns: self, self, profiler