code: def _eager_function_handler(input_signature):
      """Run the given function in eager mode.
  
      Args:
        input_signature: A possibly nested sequence of `tf.TensorSpec` objects
          specifying the shapes and dtypes of the Tensors that will be supplied to
          this function.
  
      Returns:
        A wrapper function that accepts arguments specified by `input_signature`.
      """
  
      def wrapper(fn):
          """Decorator that runs decorated function in eager mode."""
  
          def _run_eagerly(
              *inputs,
          ):  # pylint: disable=missing-docstring
              with context.eager_mode():
                  constants = [
                      _wrap_as_constant(value, tensor_spec)
                      for value, tensor_spec in zip(
                          inputs, input_signature
                      )
                  ]
                  output = fn(*constants)
                  if hasattr(output, "_make"):
                      return output._make(
                          [np.asarray(tensor) for tensor in output]
                      )
                  if isinstance(output, (tuple, list)):
                      return [
                          tensor.to_list()
                          if isinstance(tensor, tf.RaggedTensor)
                          else np.asarray(tensor)
                          for tensor in output
                      ]
                  elif isinstance(output, tf.RaggedTensor):
                      return output.to_list()
                  else:
                      return np.asarray(output)
  
          return _run_eagerly
  
      return wrapper
  
imports: from builtins import zip
  import functools
  import inspect
  import itertools
  import os
  from absl.testing import parameterized
  import numpy
  import tensorflow
  import unittest
  from tensorflow.python import tf2
  from tensorflow.python.eager import context
label_desc: Use image node_id 8 for calling a global function with example usage: _eager_function_handler(input_signature) and returns: wrapper, _run_eagerly, output, unknown, output, np