code: def parse_train_args(*args, **kwargs):
      parser = argparse.ArgumentParser(description="Model training")
      # params of training
      parser.add_argument(
          "--config",
          dest="cfg",
          help="Config file.",
          default=None,
          type=str,
      )
      parser.add_argument(
          "--iters",
          help="Iterations for training.",
          type=int,
          default=None,
      )
      parser.add_argument(
          "--batch_size",
          help="Mini batch size on each GPU (or on CPU).",
          type=int,
          default=None,
      )
      parser.add_argument(
          "--learning_rate",
          help="Learning rate.",
          type=float,
          default=None,
      )
      parser.add_argument(
          "--save_interval",
          help="How many iters to save a model snapshot once during training.",
          type=int,
          default=1000,
      )
      parser.add_argument(
          "--resume_model",
          help="Path of the model snapshot to resume.",
          type=str,
          default=None,
      )
      parser.add_argument(
          "--save_dir",
          help="Directory to save the model snapshot.",
          type=str,
          default="./output",
      )
      parser.add_argument(
          "--keep_checkpoint_max",
          help="Maximum number of checkpoints to save during training.",
          type=int,
          default=5,
      )
      parser.add_argument(
          "--num_workers",
          help="Number of workers used in data loader.",
          type=int,
          default=0,
      )
      parser.add_argument(
          "--do_eval",
          help="To perform evaluation during training.",
          action="store_true",
      )
      parser.add_argument(
          "--log_iters",
          help="Logs will be displayed at every `log_iters`.",
          default=10,
          type=int,
      )
      parser.add_argument(
          "--use_vdl",
          help="To enable VisualDL during training.",
          action="store_true",
      )
      parser.add_argument(
          "--eval_sem",
          help="To calculate semantic segmentation metrics.",
          action="store_true",
      )
      parser.add_argument(
          "--eval_ins",
          help="To calculate instance segmentation metrics.",
          action="store_true",
      )
      parser.add_argument(
          "--precision",
          default="fp32",
          type=str,
          choices=["fp32", "fp16"],
          help="Use AMP (auto mixed precision) if `precision`='fp16'.",
      )
      parser.add_argument(
          "--amp_level",
          default="O1",
          type=str,
          choices=["O1", "O2"],
          help="Auto mixed precision level. Accepted values are “O1” and “O2”: On O1 level, the input \
                  data type of each operator will be casted according to a white list and a black list. \
                  On O2 level, all parameters and input data will be casted to fp16, except those for the \
                  operators in the black list, those without the support for fp16 kernel, and those for \
                  the batchnorm layers. Default is O1.",
      )
      parser.add_argument(
          "--debug", help="To enable debug mode.", action="store_true"
      )
      parser.add_argument(
          "--device",
          help="Device for training model.",
          default="gpu",
          choices=["cpu", "gpu", "xpu", "npu", "mlu"],
          type=str,
      )
      parser.add_argument(
          "--profiler_options",
          type=str,
          help="Options of the training profiler. If `profiler_options` is not None, the training profiler will be enabled. Refer to `paddleseg/utils/train_profiler.py` for details.",
      )
      parser.add_argument(
          "--seed", help="Random seed.", default=None, type=int
      )
      parser.add_argument(
          "--opts",
          help="Update the key-value pairs of existing options.",
          nargs="+",
      )
  
      return parser.parse_args(*args, **kwargs)
  
imports: import argparse
  from paddleseg.utils import logger, utils
  from paddlepanseg.core import train
  from paddlepanseg.cvlibs import Config, make_default_builder
label_desc: Use image node_id 1 for calling a global function with example usage: parse_train_args() and returns: parser