def MergeArgs(old_args, new_args):
  """Merges two arg lists and overwrites with items from new_args on conflict.

  Args:
    old_args: the old arg list.
    new_args: the new arg list.

  Returns:
    A merged arg list.
  """
  args = list(old_args)
  for new_arg in new_args:
    found = False
    for i, element in enumerate(args):
      if element.name == new_arg.name:
        found = True
        args[i] = new_arg
        break
    if not found:
      args.append(new_arg)
  return args