code: def get_func_code(func):
      """Returns func_code of passed callable, or None if not available."""
      _, func = tf_decorator.unwrap(func)
      if callable(func):
          if tf_inspect.isfunction(func) or tf_inspect.ismethod(func):
              return func.__code__
          # Since the object is not a function or method, but is a callable, we will
          # try to access the __call__method as a function.  This works with callable
          # classes but fails with functool.partial objects despite their __call__
          # attribute.
          try:
              return func.__call__.__code__
          except AttributeError:
              return None
      else:
          raise ValueError(
              "Argument `func` must be a callable. "
              f"Received func={func} (of type {type(func)})"
          )
  
file_path: tensorflow-upstream/tensorflow/python/util/function_utils.py
imports: import functools
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.util import tf_decorator
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 6 for calling a global function with example usage: get_func_code(func) and returns: func, func, None