code: def map_arg(**maps):
      
      def deco(func):
          @functools.wraps(func)
          def wrapper(*args, **kwargs):
              if six.PY2:
                  argmap = inspect.getcallargs(func, *args, **kwargs)
              else:
                  # getcallargs was deprecated since 3.5
                  sig = inspect.signature(func)
                  argmap = sig.bind_partial(*args, **kwargs).arguments
              for k, map_func in six.iteritems(maps):
                  if k in argmap:
                      argmap[k] = map_func(argmap[k])
              return func(**argmap)
          return wrapper
      return deco
docs: Apply a mapping on certain argument before calling the original function.
  
      Args:
          maps (dict): {argument_name: map_func}