code: def _forward_time_pre_hook(
      timer_mapping: Dict[str, float]
      # pyre-ignore: Invalid type parameters [24]
  ) -> Callable[[str], Callable]:
      # pyre-ignore: Missing parameter annotation [2]
      def intermediate_hook(
          module_name: str,
      ) -> Callable[[torch.nn.Module, Any], None]:
          def hook(_module: torch.nn.Module, _inp: Any) -> None:
              timer_mapping[module_name] = perf_counter()
  
          return hook
  
      return intermediate_hook
  
imports: import copy
  import math
  import warnings
  from collections import defaultdict, deque
  from dataclasses import dataclass, field
  from enum import Enum
  from time import perf_counter
  from typing import Any, Callable, DefaultDict, Deque, Dict, List, MutableMapping, Optional, Tuple, Union
  import torch
  from torch.nn.parameter import UninitializedParameter
  from torch.utils._pytree import PyTree, tree_flatten
  from torch.utils.hooks import RemovableHandle
  from torchtnt.utils.version import is_torch_version_geq_1_13
  from typing_extensions import Literal
label_desc: Use image node_id 13 for calling a global function with example usage: _forward_time_pre_hook(timer_mapping) and returns: intermediate_hook, hook