code: def _get_num_traces(fn) -> Optional[int]:
      if isinstance(fn, _AssertMaxTraces):
          return _traces[fn.tag]
      elif hasattr(fn, "__wrapped__"):
          return _get_num_traces(fn.__wrapped__)
      else:
          return None
  
imports: import functools
  import inspect
  import weakref
  from collections.abc import Callable
  from typing import Optional, overload, TypeVar
  from typing_extensions import ParamSpec
  from .._custom_types import sentinel
  from .._eval_shape import filter_eval_shape
  from .._module import field, Module, module_update_wrapper
  from .._pretty_print import tree_pformat
  from .._tree import tree_equal
label_desc: Use image node_id 5 for calling a global function with example usage: _get_num_traces(fn) and returns: _traces, _get_num_traces, None