code: def get_arg_parser():
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "--data_location",
          help="Full path of train data",
          required=False,
          default="./data",
      )
      parser.add_argument(
          "--steps",
          help="set the number of steps on train dataset",
          type=int,
          default=0,
      )
      parser.add_argument(
          "--batch_size",
          help="Batch size to train. Default is 512",
          type=int,
          default=512,
      )
      parser.add_argument(
          "--output_dir",
          help="Full path to model output directory. \
                              Default to ./result. Covered by --checkpoint. ",
          required=False,
          default="./result",
      )
      parser.add_argument(
          "--checkpoint",
          help="Full path to checkpoints input/output. \
                              Default to ./result/$MODEL_TIMESTAMP",
          required=False,
      )
      parser.add_argument(
          "--save_steps",
          help="set the number of steps on saving checkpoints",
          type=int,
          default=0,
      )
      parser.add_argument(
          "--seed",
          help="set the random seed for tensorflow",
          type=int,
          default=2021,
      )
      parser.add_argument(
          "--optimizer",
          type=str,
          choices=["adam", "adamasync", "adagraddecay", "adagrad"],
          default="adamasync",
      )
      parser.add_argument(
          "--linear_learning_rate",
          help="Learning rate for linear model",
          type=float,
          default=0.2,
      )
      parser.add_argument(
          "--deep_learning_rate",
          help="Learning rate for deep model",
          type=float,
          default=0.01,
      )
      parser.add_argument(
          "--keep_checkpoint_max",
          help="Maximum number of recent checkpoint to keep",
          type=int,
          default=1,
      )
      parser.add_argument(
          "--timeline",
          help="number of steps on saving timeline. Default 0",
          type=int,
          default=0,
      )
      parser.add_argument(
          "--protocol",
          type=str,
          choices=["grpc", "grpc++", "star_server"],
          default="grpc",
      )
      parser.add_argument(
          "--inter",
          help="set inter op parallelism threads.",
          type=int,
          default=0,
      )
      parser.add_argument(
          "--intra",
          help="set inter op parallelism threads.",
          type=int,
          default=0,
      )
      parser.add_argument(
          "--input_layer_partitioner",
          help="slice size of input layer partitioner, units MB. Default 8MB",
          type=int,
          default=8,
      )
      parser.add_argument(
          "--dense_layer_partitioner",
          help="slice size of dense layer partitioner, units KB. Default 16KB",
          type=int,
          default=16,
      )
      parser.add_argument(
          "--bf16",
          help="enable DeepRec BF16 in deep model. Default FP32",
          action="store_true",
      )
      parser.add_argument(
          "--no_eval",
          help="not evaluate trained model by eval dataset.",
          action="store_true",
      )
      parser.add_argument(
          "--tf",
          help="Use TF 1.15.5 API and disable DeepRec feature to run a baseline.",
          action="store_true",
      )
      parser.add_argument(
          "--smartstaged",
          help="Whether to enable smart staged feature of DeepRec, Default to True.",
          type=boolean_string,
          default=True,
      )
      parser.add_argument(
          "--emb_fusion",
          help="Whether to enable embedding fusion, Default to True.",
          type=boolean_string,
          default=True,
      )
      parser.add_argument(
          "--ev",
          help="Whether to enable DeepRec EmbeddingVariable. Default False.",
          type=boolean_string,
          default=False,
      )
      parser.add_argument(
          "--ev_elimination",
          help="Feature Elimination of EmbeddingVariable Feature. Default closed.",
          type=str,
          choices=[None, "l2", "gstep"],
          default=None,
      )
      parser.add_argument(
          "--ev_filter",
          help="Feature Filter of EmbeddingVariable Feature. Default closed.",
          type=str,
          choices=[None, "counter", "cbf"],
          default=None,
      )
      parser.add_argument(
          "--op_fusion",
          help="Whether to enable Auto graph fusion feature. Default to True",
          type=boolean_string,
          default=True,
      )
      parser.add_argument(
          "--micro_batch",
          help="Set num for Auto Mirco Batch. Default close.",
          type=int,
          default=0,
      )  # TODO: Default to True
      parser.add_argument(
          "--adaptive_emb",
          help="Whether to enable Adaptive Embedding. Default to False.",
          type=boolean_string,
          default=False,
      )
      parser.add_argument(
          "--dynamic_ev",
          help="Whether to enable Dynamic-dimension Embedding Variable. "
          "Default to False.",
          type=boolean_string,
          default=False,
      )  # TODO: enable
      parser.add_argument(
          "--incremental_ckpt",
          help="Set time of save Incremental Checkpoint. Default 0 to close.",
          type=int,
          default=0,
      )
      parser.add_argument(
          "--workqueue",
          help="Whether to enable Work Queue. Default to False.",
          type=boolean_string,
          default=False,
      )
      parser.add_argument(
          "--cluster_mode",
          help="The cluster mode, such as local, k8s and yarn.",
          type=str,
          default="local",
      )
      parser.add_argument(
          "--num_nodes",
          help="The number of nodes to use in the cluster.",
          type=int,
          default=1,
      )
      parser.add_argument(
          "--cores",
          help="The number of cpu cores to use on each node.",
          type=int,
          default=8,
      )
      parser.add_argument(
          "--instances_per_node",
          help="The number of ps and worker instances to run on each node.",
          type=int,
          default=1,
      )
      parser.add_argument(
          "--master",
          help="k8s master ip and port.",
          type=str,
          default=None,
      )
      parser.add_argument(
          "--num_ps",
          help="The number of parameter servers to use.",
          type=int,
          default=1,
      )
      parser.add_argument(
          "--in_memory",
          help="Whether to run the example based on in-memory data ingestion.",
          action="store_true",
      )
      return parser
  
imports: import time
  import argparse
  import tensorflow
  import os
  import sys
  import math
  import collections
  from tensorflow.python.client import timeline
  import json
  from tensorflow.python.ops import partitioned_variables
  import ray
  from bigdl.dllib.utils.log4Error import *
  from bigdl.orca import init_orca_context, stop_orca_context, OrcaContext
  from bigdl.orca.data.utils import process_spark_xshards
  from bigdl.orca.learn.utils import maybe_dataframe_to_xshards
  from bigdl.friesian.feature import FeatureTable
label_desc: Use image node_id 6 for calling a global function with example usage: get_arg_parser() and returns: parser