def func_name_scope():
  """Decorator that adds the current function name as a variable scope.

  WARNING: EXPERIMENTAL (may conflict with other decorators).

  This makes things like `input_fn`s easier to debug. Be aware that this will
  affect Variables containing parameters when used within a `model_fn` (and so
  using it there might be more brittle).

  Returns:
    Behind the scenes, returns the result of the decorated function, potentially
    with a result modified to dynamically do contract checking, if necessary.
  """

  def decorator(func):
    """Invoked by Python when `@contract` is used as a function decorator."""

    def add_scope(*args: Any, **kwargs: Dict[Text, Any]):
      pretty_func_name = "{}.{}".format(func.__module__, func.__name__)
      with tf.variable_scope(pretty_func_name):
        return func(*args, **kwargs)
    return add_scope
  return decorator
Decorator that adds the current function name as a variable scope.

  WARNING: EXPERIMENTAL (may conflict with other decorators).

  This makes things like `input_fn`s easier to debug. Be aware that this will
  affect Variables containing parameters when used within a `model_fn` (and so
  using it there might be more brittle).

  Returns:
    Behind the scenes, returns the result of the decorated function, potentially
    with a result modified to dynamically do contract checking, if necessary.
  
language/canine/tensor_contracts.py