code: def __call__(self, cls_or_func):
      if inspect.isfunction(cls_or_func):
          fmt = (
              "Call to deprecated function or method {name} ({reason})."
          )
  
      elif inspect.isclass(cls_or_func):
          fmt = "Call to deprecated class {name} ({reason})."
  
      else:
          raise TypeError(type(cls_or_func))
  
      msg = fmt.format(
          name=self.name or cls_or_func.__name__, reason=self.reason
      )
  
      @functools.wraps(cls_or_func)
      def new_func(*args, **kwargs):
          warn(msg)
          return cls_or_func(*args, **kwargs)
  
      return new_func
  
file_path: wandb/wandb/vendor/promise-2.3.0/wandb_promise/utils.py
imports: import functools
  import inspect
  import types
  import warnings
  import sys
label_desc: Use image node_id 2 for calling the deprecated obj's underlying member method code with example usage: obj.__call__(cls_or_func) and returns: new_func, cls_or_func