code: def _create_wrapped_leaf_func(
      tracer: ConcreteTracer,
      func: Callable,
      to_func: Optional[Callable],
      init_tracers=(),
  ):
      # to_func: to call correct replacement instead of the original (the original func may be wrong).
      #          such as: call torch.nn.norm instead of torch._C._VariableFunctions.norm.
      #                   torch.nn.norm will help to pack dim to list if dim is an int.
      if to_func is None:
          to_func = func
  
      @functools.wraps(func)
      def func_wrapper(*args, **kwargs):
          if tracer.temp_disable_call:
              return func(*args, **kwargs)
          tracers = _orig_set(init_tracers)
  
          def unwrap_detect_tracers(obj):
              if isinstance(obj, ep.ConcreteProxy):
                  tracers.add(obj.tracer)
  
          ep.map_aggregate_not_proxy(args, unwrap_detect_tracers)
          ep.map_aggregate_not_proxy(kwargs, unwrap_detect_tracers)
          if _orig_len(tracers) == 0:
              return to_func(*args, **kwargs)
          elif (
              _orig_len(tracers) == 1 and next(iter(tracers)) == tracer
          ):
              return tracer.create_proxy(
                  "call_function", to_func, args, kwargs
              )
          else:
              raise Exception(
                  "more than 1 tracer detected. please report the issue"
              )
  
      return func_wrapper
  
imports: from __future__ import annotations
  import collections
  import copy
  import sys
  import inspect
  import logging
  import operator
  import functools
  import builtins
  from itertools import chain
  from types import BuiltinMethodType, FunctionType, MethodDescriptorType, MethodType, MethodWrapperType, ModuleType
  from typing import Any, Dict, Iterable, Iterator, Optional, Set, Tuple, Type, List, Callable, Union
  from contextlib import contextmanager
  import torch
  from torch._C import ScriptObject
  from torch.nn.modules.container import Sequential, ModuleList, ModuleDict, ParameterList, ParameterDict
  from torch.utils._pytree import tree_map
  import torch.fx
  from torch.fx import GraphModule
  from torch.fx._compatibility import compatibility
  from torch.fx._symbolic_trace import _Patcher, _proxyable_classes
  from torch.fx.graph import Graph
  from torch.fx.node import Target, Node, Argument, _side_effectful_functions
  from torch.fx.proxy import TracerBase
  from torch.fx.operator_schemas import check_for_mutable_operation
  from .None import concrete_proxy
  from .operator_patcher import OperatorPatcherContext
  from .utils import _orig_module_call, _orig_module_getattr, _orig_module_getattribute, _orig_agfunc_apply, _orig_torch_assert, _orig_type, _orig_isinstance, _orig_issubclass, _orig_getattr, _orig_range, _orig_int, _orig_bool, _orig_tuple, _orig_list, _orig_set, _orig_frozenset, _orig_dict, _orig_map, _orig_zip, _orig_enumerate, _orig_slice, _orig_reversed, _orig_torch_size, _orig_torch_finfo, _orig_len, _orig_not, _orig_is, _orig_is_not, _orig_contains, _orig_index, _orig_all, _orig_min, _orig_max, _orig_node_is_impure
label_desc: Use image node_id 6 for calling a global function with example usage: _create_wrapped_leaf_func(tracer, func, to_func, init_tracers) and returns: func_wrapper, func, to_func, tracer