code: def _time_logger(func: Callable[_P, _T]) -> Callable[_P, _T]:
      @functools.wraps(func)
      def wrapper(*args: _P.args, **kwargs: _P.kwargs) -> _T:
          t1 = time.time_ns()
          func_return = func(*args, **kwargs)
          time_spent = time.time_ns() - t1
  
          msg_dict = _get_msg_dict(func.__name__, *args, **kwargs)
          msg_dict["time_spent"] = f"{time_spent}ns"
          _c10d_logger.debug(msg_dict)
  
          return func_return
  
      return wrapper
  
file_path: pytorch/torch/distributed/c10d_logger.py
imports: import functools
  import logging
  import time
  from typing import Any, Callable, Dict, List, Tuple, TypeVar
  from typing_extensions import ParamSpec
  import torch
  import torch.distributed
  from torch.distributed.logging_handlers import _log_handlers
label_desc: Use image node_id 5 for calling a global function with example usage: _time_logger(func) and returns: wrapper, func_return