code: def no_name_scope(method: T) -> T:
      """Decorator to wrap a method, preventing automatic name scope wrapping.
  
      By default, any method on a module is considered as a forwards function, and
      so any variables / modules created by the method will be scoped as belonging
      to the module. In some cases this is undesirable, for example when
      implementing ``.clone()`` / ``.transpose()``, as in those cases we want the
      new module to have the scope of wherever the ``.transpose()`` call is made. To
      allow this, decorate any methods with ``no_name_scope``.
  
      Args:
        method: the method to wrap.
  
      Returns:
        The method, with a flag indicating no name scope wrapping should occur.
      """
      # NOTE: This logic is tied to ModuleMetaclass.__new__, if anything is
      # changed here corresponding changes will be needed there.
      setattr(method, APPLY_NAME_SCOPE, False)
      return method
  
imports: import abc
  import functools
  import inspect
  import os
  import pprint
  import sys
  from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Type, TypeVar
  from sonnet.src import once
  from sonnet.src import types
  from sonnet.src import utils
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: no_name_scope(method) and returns: method