code: def get_args():
      parser = ArgumentParser()
      parser.add_argument(
          "--checkpoint_folder",
          type=str,
          default=None,
          required=True,
          help="Path to Megatron-LM checkpoints saved during training. Ex: /raid/Megatron_LM/checkpoints",
      )
      parser.add_argument(
          "--checkpoint_name",
          type=str,
          default="model_optim_rng.pt",
          required=True,
          help="Name of checkpoint to be used. Ex: model_optim_rng.pt",
      )
  
      parser.add_argument(
          "--hparams_file",
          type=str,
          default=None,
          required=False,
          help="Path config for restoring. It's created during training and may need to be modified during restore if restore environment is different than training. Ex: /raid/nemo_experiments/megatron_gpt/hparams.yaml",
      )
      parser.add_argument(
          "--nemo_file_path",
          type=str,
          default=None,
          required=False,
          help="Path to output .nemo file.",
      )
  
      parser.add_argument(
          "--output_ckpt_file_path",
          type=str,
          default=None,
          required=False,
          help="Path to output .ckpt file.",
      )
  
      parser.add_argument(
          "--gpus_per_node", type=int, required=False, default=1
      )
  
      parser.add_argument(
          "--tensor_model_parallel_size",
          type=int,
          required=True,
          default=None,
      )
      parser.add_argument(
          "--pipeline_model_parallel_size",
          type=int,
          required=False,
          default=1,
      )
  
      parser.add_argument(
          "--local_rank",
          type=int,
          required=False,
          default=os.getenv("LOCAL_RANK", -1),
      )
  
      parser.add_argument(
          "--model_type",
          type=str,
          required=True,
          default="gpt",
          choices=["gpt", "t5", "bert"],
      )
  
      args = parser.parse_args()
      return args
  
imports: import importlib
  import os
  import pathlib
  import sys
  from argparse import ArgumentParser
  from collections import OrderedDict
  from typing import Any, Optional
  import torch
  from lightning_fabric.utilities.cloud_io import _load
  from megatron.core import parallel_state
  from pytorch_lightning.core.saving import _load_state
  from pytorch_lightning.core.saving import load_hparams_from_tags_csv, load_hparams_from_yaml
  from pytorch_lightning.trainer.trainer import Trainer
  from pytorch_lightning.utilities.migration import pl_legacy_patch
  from nemo.collections.nlp.models.language_modeling.megatron_bert_model import MegatronBertModel
  from nemo.collections.nlp.models.language_modeling.megatron_gpt_model import MegatronGPTModel
  from nemo.collections.nlp.modules.common.megatron.megatron_init import initialize_model_parallel_for_nemo
  from nemo.collections.nlp.parts.nlp_overrides import NLPSaveRestoreConnector
  from nemo.utils import AppState, logging
  from nemo.utils.distributed import initialize_distributed
  from nemo.utils.model_utils import inject_model_parallel_rank, uninject_model_parallel_rank
label_desc: Use image node_id 2 for calling a global function with example usage: get_args() and returns: args