def group_arg_and_key(parameter_arg_and_keys):
  """
  Group argnames based on key
  :param parameter_arg_and_keys: [{"name": <arg_name>, "key": <arg_key>}]
  :return: {"<arg_key>": [<arg_name1>, <arg_name2>]}
  """
  keys_argnames_dict = {}
  for parameter_arg_and_key in parameter_arg_and_keys:
    typ = parameter_arg_and_key["key"]
    name = parameter_arg_and_key["name"]
    if typ in keys_argnames_dict:
      keys_argnames_dict[typ].append(name)
    else:
      keys_argnames_dict[typ] = [name]
  return keys_argnames_dict