code: def parse_args():
      parser = argparse.ArgumentParser(description="Model training")
  
      # Common params
      parser.add_argument(
          "--config", help="The path of config file.", type=str
      )
      parser.add_argument(
          "--device",
          help="Set the device place for training model.",
          default="gpu",
          choices=["cpu", "gpu", "xpu", "npu", "mlu"],
          type=str,
      )
      parser.add_argument(
          "--save_dir",
          help="The directory for saving the model snapshot.",
          type=str,
          default="./output",
      )
      parser.add_argument(
          "--num_workers",
          help="Number of workers for data loader. Bigger num_workers can speed up data processing.",
          type=int,
          default=0,
      )
      parser.add_argument(
          "--do_eval",
          help="Whether to do evaluation in training.",
          action="store_true",
      )
      parser.add_argument(
          "--use_vdl",
          help="Whether to record the data to VisualDL in training.",
          action="store_true",
      )
  
      # Runntime params
      parser.add_argument(
          "--resume_model",
          help="The path of the model to resume training.",
          type=str,
      )
      parser.add_argument(
          "--nepochs", help="Iterations in training.", type=int
      )
      parser.add_argument(
          "--batch_size",
          help="Mini batch size of one gpu or cpu. ",
          type=int,
      )
      parser.add_argument(
          "--labeled_ratio",
          help="The ratio of total data to labeled data, if 2, is 1/2, i.e. 0.5",
          type=int,
          default=2,
      )
      parser.add_argument(
          "--learning_rate", help="Learning rate.", type=float
      )
      parser.add_argument(
          "--save_epoch",
          help="How many epochs to save a model snapshot once during training.",
          type=int,
          default=5,
      )
      parser.add_argument(
          "--log_iters",
          help="Display logging information at every `log_iters`.",
          default=10,
          type=int,
      )
      parser.add_argument(
          "--keep_checkpoint_max",
          help="Maximum number of checkpoints to save.",
          type=int,
          default=5,
      )
  
      # Other params
      parser.add_argument(
          "--seed",
          help="Set the random seed in training.",
          default=None,
          type=int,
      )
      parser.add_argument(
          "--profiler_options",
          type=str,
          help="The option of train profiler. If profiler_options is not None, the train "
          "profiler is enabled. Refer to the paddleseg/utils/train_profiler.py for details.",
      )
      parser.add_argument(
          "--data_format",
          help='Data format that specifies the layout of input. It can be "NCHW" or "NHWC". Default: "NCHW".',
          type=str,
          default="NCHW",
      )
      parser.add_argument(
          "--opts",
          help="Update the key-value pairs of all options.",
          nargs="+",
      )
  
      return parser.parse_args()
  
file_path: PaddleSeg/contrib/CrossPseudoSupervision/train.py
imports: import argparse
  import datasets
  import models
  from cvlibs import Config, CPSBuilder
  from paddleseg.utils import utils
  from core import train
label_desc: Use image node_id 1 for calling a global function with example usage: parse_args() and returns: parser