code: def _current_module_pre_hook(
      name: str, module: nn.Module, *args, **kwargs
  ) -> None:
      from .shape_formula import find_shape_inference_formula
  
      # Sometimes the same module has multiple shape inference hooks.
      if _current_module_names and _current_module_names[-1].id == id(
          module
      ):
          return
      _current_module_names.append(
          _ModuleName(
              id(module),
              name,
              type(module).__module__ + "." + type(module).__name__,
              find_shape_inference_formula(module) is not None,
          )
      )
  
imports: from __future__ import annotations
  import functools
  import logging
  import traceback
  from typing import Union, Tuple, Callable, Iterable, Any, NamedTuple, Dict, cast, overload
  import torch
  from torch import nn
  from torch.utils.hooks import RemovableHandle
  from nni.mutable import MutableExpression, Mutable, LabeledMutable, Sample, SampleValidationError
  from nni.mutable.mutable import _mutable_equal
  from .misc import is_leaf_module, argument_in_spec
label_desc: Use image node_id 9 for calling a global function with example usage: _current_module_pre_hook(name, module) without return types