code: def parse_args():
      parser = argparse.ArgumentParser(description=__doc__)
      parser.add_argument(
          "--ckpt_dir",
          type=str,
          default="./ckpt_dir",
          help="Path to checkpoint directory",
      )
      parser.add_argument(
          "--data_dir",
          type=str,
          default=None,
          help="Path to raw data, required if --raw set True",
      )
      parser.add_argument(
          "--log_interval",
          type=int,
          default=250,
          help="Report interval",
      )
      parser.add_argument(
          "--ckpt_interval",
          type=int,
          default=25000,
          help="Checkpoint interval",
      )
      # model
      parser.add_argument(
          "--model_name",
          type=str,
          default="google_en_cased_bert_base",
          help="Name of the pretrained model.",
      )
      # training
      parser.add_argument(
          "--seed", type=int, default=100, help="Random seed"
      )
      parser.add_argument(
          "--data",
          type=str,
          default=None,
          help="Path to pretraining corpus file. File name with wildcard such as"
          " dir/*.npz is accepted. Or file name with wildcard such as dir/*.txt if"
          " --raw is set.",
      )
      parser.add_argument(
          "--batch_size",
          type=int,
          default=8,
          help="Batch size. Number of examples per gpu in a minibatch. default is 8",
      )
      parser.add_argument(
          "--num_accumulated",
          type=int,
          default=1,
          help="Number of batches for gradient accumulation. "
          "total_batch_size = batch_size_per_worker * num_worker * accumulate.",
      )
      parser.add_argument(
          "--num_steps",
          type=int,
          default=20,
          help="Number of optimization steps",
      )
      parser.add_argument(
          "--optimizer",
          type=str,
          default="adamw",
          help="The optimization algorithm",
      )
      parser.add_argument(
          "--start_step",
          type=int,
          default=0,
          help="Start optimization step from the checkpoint.",
      )
      parser.add_argument(
          "--lr", type=float, default=1e-4, help="Learning rate"
      )
      parser.add_argument(
          "--wd", type=float, default=0.01, help="weight decay"
      )
      parser.add_argument(
          "--max_grad_norm",
          type=float,
          default=1.0,
          help="Max gradient norm.",
      )
      parser.add_argument(
          "--warmup_ratio",
          type=float,
          default=0.01,
          help="Ratio of warmup steps in the learning rate scheduler.",
      )
      parser.add_argument(
          "--no_compute_acc",
          action="store_true",
          help="skip accuracy metric computation during training",
      )
      # debugging
      parser.add_argument(
          "--verbose", action="store_true", help="verbose logging"
      )
      # data pre-processing
      parser.add_argument(
          "--num_buckets",
          type=int,
          default=1,
          help="Number of buckets for variable length sequence sampling",
      )
      parser.add_argument(
          "--raw",
          action="store_true",
          help="If set, both training and dev samples are generated on-the-fly "
          "from raw texts instead of pre-processed npz files. ",
      )
      parser.add_argument(
          "--max_seq_length",
          type=int,
          default=512,
          help="Maximum input sequence length. Effective only if --raw is set.",
      )
      parser.add_argument(
          "--short_seq_prob",
          type=float,
          default=0.1,
          help="The probability of producing sequences shorter than max_seq_length. "
          "Effective only if --raw is set.",
      )
      parser.add_argument(
          "--masked_lm_prob",
          type=float,
          default=0.15,
          help="Probability for masks. Effective only if --raw is set.",
      )
      parser.add_argument(
          "--max_predictions_per_seq",
          type=int,
          default=80,
          help="Maximum number of predictions per sequence. "
          "Effective only if --raw is set.",
      )
      parser.add_argument(
          "--whole_word_mask",
          action="store_true",
          help="Whether to use whole word masking rather than per-subword masking."
          "Effective only if --raw is set.",
      )
      parser.add_argument(
          "--random_next_sentence",
          action="store_true",
          help="Whether to use the sentence order prediction objective as in ALBERT"
          "Effective only if --raw is set.",
      )
      parser.add_argument(
          "--num_dataset_workers",
          type=int,
          default=0,
          help="Number of workers to pre-process dataset.",
      )
      parser.add_argument(
          "--num_batch_workers",
          type=int,
          default=0,
          help="Number of workers to pre-process mini-batch.",
      )
      parser.add_argument(
          "--circle_length",
          type=int,
          default=2,
          help="Number of files to be read for a single GPU at the same time.",
      )
      parser.add_argument(
          "--repeat",
          type=int,
          default=8,
          help="Number of times that files are repeated in each shuffle.",
      )
      parser.add_argument(
          "--dataset_cached",
          action="store_true",
          help="Whether or not to cache the last processed training dataset.",
      )
      parser.add_argument(
          "--num_max_dataset_cached",
          type=int,
          default=0,
          help="Maximum number of cached processed training dataset.",
      )
      # phase 2
      parser.add_argument(
          "--phase2", action="store_true", help="phase 2 training"
      )
      parser.add_argument(
          "--phase1_num_steps",
          type=int,
          help="number of steps for phase 1",
      )
      # use amp
      parser.add_argument(
          "--use_amp", action="store_true", help="use amp"
      )
      # communication
      parser.add_argument(
          "--comm_backend",
          type=str,
          default="device",
          choices=["byteps", "horovod", "dist_sync_device", "device"],
          help="Communication backend.",
      )
      parser.add_argument(
          "--gpus",
          type=str,
          default=None,
          help="List of gpus to run when device or dist_sync_device is used for "
          "communication, e.g. 0 or 0,2,5. empty means using cpu.",
      )
  
      args = parser.parse_args()
      return args
  
file_path: gluon-nlp/scripts/pretraining/bert/run_pretraining.py
imports: import os
  import time
  import shutil
  import logging
  import argparse
  import functools
  import collections
  import mxnet
  import numpy
  from pretraining_utils import get_pretrain_data_npz, get_pretrain_data_text, MaskedAccuracy
  from gluonnlp.utils.misc import repeat, grouper, set_seed, init_comm, logging_config, naming_convention
  from gluonnlp.initializer import TruncNorm
  from gluonnlp.models.bert import BertModel, BertForPretrain, get_pretrained_bert
  from gluonnlp.utils.parameter import clip_grad_global_norm
label_desc: Use image node_id 1 for calling a global function with example usage: parse_args() and returns: args