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
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`.
  
tensorflow_transform/test_case.py