code: def check_and_process_args(args):
      # Precess the scope of run
      run_scope = None
      for scope in RunScope:
          if args.run_scope == scope.value:
              run_scope = scope
              break
      assert (
          run_scope is not None
      ), f"only support {[scope.value for scope in RunScope]} as run_scope"
      args.run_scope = run_scope
  
      # Precess image layout and channel
      args.image_channel = args.image_shape[0]
      if args.data_layout == "NHWC":
          args.image_shape = [
              args.image_shape[1],
              args.image_shape[2],
              args.image_shape[0],
          ]
  
      # Precess learning rate
      args.lr = get_num_trainers() * args.lr
  
      # Precess model loading
      assert not (
          args.from_checkpoint is not None
          and args.from_pretrained_params is not None
      ), (
          "--from-pretrained-params and --from-checkpoint should "
          "not be set simultaneously."
      )
      _get_full_path_of_pretrained_params(args)
      _get_full_path_of_ckpt(args)
      args.start_epoch = args.last_epoch_of_checkpoint + 1
  
      # Precess benchmark
      if args.benchmark:
          assert args.run_scope in [
              RunScope.TRAIN_ONLY,
              RunScope.EVAL_ONLY,
          ], "If benchmark enabled, run_scope must be `train_only` or `eval_only`"
  
      # Only run one epoch when benchmark or eval_only.
      if args.benchmark or (args.run_scope == RunScope.EVAL_ONLY):
          args.epochs = args.start_epoch + 1
  
      if args.run_scope == RunScope.EVAL_ONLY:
          args.eval_interval = 1
  
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 4 for calling a global function with example usage: check_and_process_args(args) without return types