code: def add_training_args(parser: argparse.ArgumentParser):
      """Training arguments."""
  
      group = parser.add_argument_group(
          "train", "training configurations"
      )
  
      group.add_argument(
          "--dataset",
          type=str,
          default="dataset.json",
          help="Path to dataset",
      )
      group.add_argument(
          "--load",
          type=str,
          default=None,
          help="Path to a directory containing a model checkpoint.",
      )
      group.add_argument(
          "--save",
          type=str,
          default=None,
          help="Output directory to save checkpoints to.",
      )
      group.add_argument(
          "--save-name",
          type=str,
          default=None,
          help="Output filename to save checkpoints to.",
      )
  
      group.add_argument(
          "--tensorboard",
          type=str,
          default=None,
          help="tensorboard directory",
      )
  
      group.add_argument(
          "--inspect-iters",
          type=int,
          default=1000,
          help="number of inspecting",
      )
      group.add_argument(
          "--batch-size",
          type=int,
          default=32,
          help="Data Loader batch size",
      )
      group.add_argument(
          "--clip-grad",
          type=float,
          default=1.0,
          help="gradient clipping",
      )
      group.add_argument(
          "--train-iters",
          type=int,
          default=1000000,
          help="total number of iterations to train over all training runs",
      )
      group.add_argument(
          "--max-length",
          type=int,
          default=512,
          help="max length of input",
      )
  
      group.add_argument(
          "--seed",
          type=int,
          default=1234,
          help="random seed for reproducibility",
      )
  
      # Learning rate.
      group.add_argument(
          "--lr",
          type=float,
          default=1.0e-4,
          help="initial learning rate",
      )
      group.add_argument(
          "--weight-decay",
          type=float,
          default=1.0e-2,
          help="weight decay rate",
      )
      group.add_argument(
          "--loss-scale", type=float, default=65536, help="loss scale"
      )
  
      group.add_argument(
          "--warmup-iters",
          type=int,
          default=100,
          help="steps for learning rate warm-up",
      )
      group.add_argument(
          "--lr-decay-style",
          type=str,
          default="noam",
          choices=[
              "constant",
              "linear",
              "cosine",
              "exponential",
              "noam",
          ],
          help="learning rate decay function",
      )
      group.add_argument(
          "--lr-decay-iters",
          type=int,
          default=None,
          help="lr decay steps",
      )
      group.add_argument(
          "--start-step",
          type=int,
          default=0,
          help="step to start or continue training",
      )
  
      return parser
  
imports: import argparse
label_desc: Use image node_id 2 for calling a global function with example usage: add_training_args(parser) and returns: parser