code: def with_native_function(func: Callable[[F], T]) -> Callable[[F], T]:
      @functools.wraps(func)
      def wrapper(f: F) -> T:
          with native_function_manager(f):
              return func(f)
  
      return wrapper
  
file_path: pytorch/torchgen/context.py
imports: import contextlib
  import functools
  from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, TypeVar, Union
  import torchgen.local
  from torchgen.model import BackendIndex, DispatchKey, NativeFunction, NativeFunctionsGroup, NativeFunctionsViewGroup
  from torchgen.utils import context, S, T
label_desc: Use image node_id 2 for calling a global function with example usage: with_native_function(func) and returns: wrapper, func