code: def echo_class(klass, write=sys.stdout.write):
      """Echo calls to class methods and static functions"""
      for _, method in inspect.getmembers(klass, inspect.ismethod):
          # In python 3 only class methods are returned here, but in python2 instance methods are too.
          echo_instancemethod(klass, method, write)
      for _, fn in inspect.getmembers(klass, inspect.isfunction):
          if is_static_method(fn, klass):
              setattr(klass, name(fn), staticmethod(echo(fn, write)))
          else:
              # It's not a class or a static method, so it must be an instance method.
              # This should only be called in python 3, because in python 3 instance methods are considered functions.
              echo_instancemethod(klass, fn, write)
  
file_path: wandb/wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/echo.py
imports: import inspect
  import sys
label_desc: Use image node_id 9 for calling a global function with example usage: echo_class(klass, write) without return types