code: def _get_args_parser() -> ArgumentParser:
      parser = ArgumentParser(description="BigDL Training Launcher")
  
      parser.add_argument(
          "--nnodes",
          type=int,
          default=1,
          help="Number of nodes",
      )
  
      parser.add_argument(
          "--image",
          type=str,
          default="yangw1234/bigdl-submit-demo:latest",
          help="Rank of the node for multi-node distributed training.",
      )
  
      parser.add_argument(
          "--driver_port",
          type=str,
          default="12345",
      )
  
      parser.add_argument("--namespace", type=str, default="default")
  
      parser.add_argument(
          "--env",
          nargs=2,
          action="append",
          default=[],
          help="pass environment variable to be set in all pods, "
          "such as --env http_proxy http://host:port",
      )
  
      parser.add_argument(
          "--pod_cpu",
          type=str,
          default="2",
      )
  
      parser.add_argument("--pod_memory", type=str, default="1G")
  
      parser.add_argument(
          "--pod_epc_memory",
          type=str,
          default="34359738368",
          help="The EPC memory allocated to the container (in bytes) if SGX mode is enabled",
      )
  
      parser.add_argument(
          "--volume",
          type=str,
          action="append",
          default=[],
          help="A Json string defining one volume in all pods",
      )
  
      parser.add_argument(
          "--volume_mount",
          type=str,
          action="append",
          default=[],
          help="A Json string specifying one volumeMount in all containers",
      )
  
      parser.add_argument(
          "--submit_pod_template",
          action="store_true",
          default=False,
          help="If set, indicate the main_script is a pod template yaml file",
      )
  
      parser.add_argument(
          "--use_command",
          action="store_true",
          default=False,
          help="If set, the script will use the command line arguments as pod's entrypoint",
      )
  
      parser.add_argument(
          "--sgx_enabled",
          action="store_true",
          default=False,
          help="If set, the corresponding sgx-related device-plugin arguments will be added",
      )
  
      parser.add_argument(
          "--node_label",
          nargs=2,
          action="append",
          default=[],
          help="choose which node to run with labels",
      )
  
      #
      # Positional arguments.
      #
  
      parser.add_argument("main_script", type=str)
  
      parser.add_argument("main_script_args", nargs=REMAINDER)
  
      return parser
  
imports: from uuid import uuid4
  from kubernetes import client, config
  from kubernetes.client import ApiClient
  from argparse import REMAINDER, ArgumentParser
  import functools
  from typing import Dict, List, Callable, Optional
  import yaml
  import json
  from os import path
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 1 for calling a global function with example usage: _get_args_parser() and returns: parser