code: def map_arg(**maps):
      """
      Apply a mapping on certain argument before calling the original function.
  
      Args:
          maps (dict): {argument_name: map_func}
      """
  
      def deco(func):
          @functools.wraps(func)
          def wrapper(*args, **kwargs):
              # getcallargs was deprecated since 3.5
              sig = inspect.signature(func)
              argmap = sig.bind_partial(*args, **kwargs).arguments
              for k, map_func in maps.items():
                  if k in argmap:
                      argmap[k] = map_func(argmap[k])
              return func(**argmap)
  
          return wrapper
  
      return deco
  
file_path: tensorpack/tensorpack/utils/argtools.py
imports: import inspect
  import functools
  from .None import logger
label_desc: Use image node_id 1 for calling a global function with example usage: map_arg() and returns: deco, wrapper, func