def _apply_args_to_job_group(job_group: job_blocks.JobGroup,
                             args: Mapping[str, Any]) -> None:
  """Recursively overrides job group properties."""
  if args:
    _check_if_unsupported_args_are_present(args, job_group.jobs.keys(),
                                           'xm.JobGroup')
    for key, job in job_group.jobs.items():
      _apply_args(job, args.get(key, {}))