code: def get_class_from_method(meth):
      """See
      https://stackoverflow.com/questions/3589311/
      get-defining-class-of-unbound-method-object-in-python-3/
      25959545#25959545
      """
      if inspect.ismethod(meth):
          for cls in inspect.getmro(meth.__self__.__class__):
              if cls.__dict__.get(meth.__name__) is meth:
                  return cls
          meth = meth.__func__  # fallback to __qualname__ parsing
      if inspect.isfunction(meth):
          cls = getattr(
              inspect.getmodule(meth),
              meth.__qualname__.split(".<locals>", 1)[0].rsplit(".", 1)[
                  0
              ],
          )
          if isinstance(cls, type):
              return cls
      return getattr(meth, "__objclass__", None)
  
file_path: autokeras/docs/keras_autodoc/utils.py
imports: import importlib
  import inspect
  import os
  import re
label_desc: Use image node_id 6 for calling a global function with example usage: get_class_from_method(meth) and returns: getattr, cls, cls