code: def _get_class_or_fn_config(obj):
      """Return the object's config depending on its type."""
      # Functions / lambdas:
      if isinstance(obj, types.FunctionType):
          return obj.__name__
      # All classes:
      if hasattr(obj, "get_config"):
          config = obj.get_config()
          if not isinstance(config, dict):
              raise TypeError(
                  f"The `get_config()` method of {obj} should return "
                  f"a dict. It returned: {config}"
              )
          return serialize_dict(config)
      elif hasattr(obj, "__name__"):
          return object_registration.get_registered_name(obj)
      else:
          raise TypeError(
              f"Cannot serialize object {obj} of type {type(obj)}. "
              "To be serializable, "
              "a class must implement the `get_config()` method."
          )
  
imports: import importlib
  import inspect
  import types
  import warnings
  import numpy
  from keras import api_export
  from keras import backend
  from keras.api_export import keras_export
  from keras.backend.common import global_state
  from keras.saving import object_registration
  from keras.utils import python_utils
  from keras.utils.module_utils import tensorflow
label_desc: Use image node_id 10 for calling a global function with example usage: _get_class_or_fn_config(obj) and returns: obj, serialize_dict, object_registration