code: def add_type_based_api_dispatcher(target):
      """Adds a PythonAPIDispatcher to the given TensorFlow API function."""
      if hasattr(target, TYPE_BASED_DISPATCH_ATTR):
          raise ValueError(
              f"{target} already has a type-based API dispatcher."
          )
  
      _, unwrapped = tf_decorator.unwrap(target)
      target_argspec = tf_inspect.getargspec(unwrapped)
      if target_argspec.varargs or target_argspec.keywords:
          # @TODO(b/194903203) Add v2 dispatch support for APIs that take varargs
          # and keywords.  Examples of APIs that take varargs and kwargs: meshgrid,
          # einsum, map_values, map_flat_values.
          return target
  
      setattr(
          target,
          TYPE_BASED_DISPATCH_ATTR,
          _api_dispatcher.PythonAPIDispatcher(
              unwrapped.__name__,
              target_argspec.args,
              target_argspec.defaults,
          ),
      )
      _TYPE_BASED_DISPATCH_SIGNATURES[target] = collections.defaultdict(
          list
      )
      return target
  
imports: import collections
  import itertools
  import typing
  from tensorflow.python.framework import _pywrap_python_api_dispatcher
  from tensorflow.python.framework import ops
  from tensorflow.python.util import tf_decorator
  from tensorflow.python.util import tf_export
  from tensorflow.python.util import tf_inspect
  from tensorflow.python.util import traceback_utils
  from tensorflow.python.util import type_annotations
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 13 for calling a global function with example usage: add_type_based_api_dispatcher(target) and returns: target, target