code: def partial_append_action(fn, argument_keys=None):
      
      if isinstance(argument_keys, str):
          argument_keys = [argument_keys]
      argument_keys = argument_keys or []
  
      class PartialAppendAction(argparse.Action):
          def __init__(self,
                       option_strings,
                       dest,
                       const=None,
                       default=None,
                       required=False,
                       help=None,
                       type=None,
                       metavar=None,
                       nargs=None,
                       **kwargs):
              super(PartialAppendAction, self).__init__(
                  option_strings=option_strings,
                  dest=dest,
                  nargs=len(argument_keys),
                  const=const,
                  default=default,
                  required=required,
                  metavar=metavar,
                  type=type,
                  help=help, **kwargs)
  
          def __call__(self, parser, namespace, values, option_string=None):
              items = copy.copy(getattr(namespace, self.dest, None)) or []
  
              # If no value was set default to empty list
              if values is None:
                  values = []
              elif not isinstance(values, list):
                  values = [values]
  
              if len(argument_keys) != len(values):
                  raise ValueError("Unexpected number of values")
  
              # Generate keyword arguments for the input function
              kwargs = dict(list(zip(argument_keys, values)))
              f = functools.partial(fn, **kwargs)
              items.append(f)
              setattr(namespace, self.dest, items)
  
      return PartialAppendAction
docs: Creates a new class extending argparse.Action, which appends a
      partially-applied function to dest.
  
      The optional argument_keys argument should either be None (no additional
      arguments to fn) or an iterable of function keys to partially apply.