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
Invoked by Python when `@contract` is used as a function decorator.
language/canine/tensor_contracts.py