code: def add_global_args(parser):
      group = parser.add_argument_group("Global")
      group.add_argument(
          "--output-dir",
          type=str,
          default="./output/",
          help="A path to store trained models.",
      )
      group.add_argument(
          "--run-scope",
          default="train_eval",
          choices=("train_eval", "train_only", "eval_only"),
          help="Running scope. It should be one of {train_eval, train_only, eval_only}.",
      )
      group.add_argument(
          "--epochs",
          type=int,
          default=90,
          help="The number of epochs for training.",
      )
      group.add_argument(
          "--save-interval",
          type=int,
          default=1,
          help="The iteration interval to save checkpoints.",
      )
      group.add_argument(
          "--eval-interval",
          type=int,
          default=1,
          help="The iteration interval to test trained models on a given validation dataset. "
          "Ignored when --run-scope is train_only.",
      )
      group.add_argument(
          "--print-interval",
          type=int,
          default=10,
          help="The iteration interval to show training/evaluation message.",
      )
      group.add_argument(
          "--report-file",
          type=str,
          default="./report.json",
          help="A file in which to store JSON experiment report.",
      )
      group.add_argument(
          "--data-layout",
          default="NCHW",
          choices=("NCHW", "NHWC"),
          help="Data format. It should be one of {NCHW, NHWC}.",
      )
      group.add_argument(
          "--benchmark",
          action="store_true",
          help="To enable benchmark mode.",
      )
      group.add_argument(
          "--benchmark-steps",
          type=int,
          default=100,
          help="Steps for benchmark run, only be applied when --benchmark is set.",
      )
      group.add_argument(
          "--benchmark-warmup-steps",
          type=int,
          default=100,
          help="Warmup steps for benchmark run, only be applied when --benchmark is set.",
      )
      group.add_argument(
          "--model-prefix",
          type=str,
          default="resnet_50_paddle",
          help="The prefix name of model files to save/load.",
      )
      group.add_argument(
          "--from-pretrained-params",
          type=str,
          default=None,
          help="A folder path which contains pretrained parameters, that is a file in name"
          " --model-prefix + .pdparams. It should not be set with --from-checkpoint"
          " at the same time.",
      )
      group.add_argument(
          "--from-checkpoint",
          type=str,
          default=None,
          help="A checkpoint path to resume training. It should not be set "
          "with --from-pretrained-params at the same time. The path provided "
          "could be a folder contains < epoch_id/ckpt_files > or < ckpt_files >.",
      )
      group.add_argument(
          "--last-epoch-of-checkpoint",
          type=str,
          default=None,
          help="The epoch id of the checkpoint given by --from-checkpoint. "
          "It should be None, auto or integer >= 0. If it is set as "
          "None, then training will start from 0-th epoch. If it is set as "
          "auto, then it will search largest integer-convertable folder "
          " --from-checkpoint, which contains required checkpoint. "
          "Default is None.",
      )
      group.add_argument(
          "--show-config",
          type=distutils.util.strtobool,
          default=True,
          help="To show arguments.",
      )
      group.add_argument(
          "--enable-cpu-affinity",
          type=distutils.util.strtobool,
          default=True,
          help="To enable in-built GPU-CPU affinity.",
      )
      return parser
  
file_path: DALI/docs/examples/use_cases/paddle/resnet50/utils/config.py
imports: import os
  import copy
  import argparse
  import logging
  import distutils.util
  import dllogger
  from utils.mode import RunScope
  from utils.utility import get_num_trainers
  from utils.save_load import _PDOPT_SUFFIX, _PDPARAMS_SUFFIX
label_desc: Use image node_id 5 for calling a global function with example usage: add_global_args(parser) and returns: parser