code: def parse_args(description, mode="train"):
      parser = argparse.ArgumentParser(description=description)
      parser.add_argument(
          "--data_dir",
          type=str,
          default="./",
          help="The path to load data from local or remote resources.",
      )
      parser.add_argument(
          "--dataset",
          type=str,
          default="ml-1m",
          choices=("ml-1m", "ml-100k"),
          help="The name of the dataset. ml-1m or ml-100k",
      )
      parser.add_argument(
          "--model_dir",
          type=str,
          default="./",
          help="The path to save model and logs.",
      )
      parser.add_argument(
          "--cluster_mode",
          type=str,
          default="local",
          choices=(
              "local",
              "yarn-client",
              "yarn-cluster",
              "k8s-client",
              "k8s-cluster",
              "spark-submit",
              "bigdl-submit",
          ),
          help="The cluster mode, one of local, yarn-client, yarn-cluster, "
          "k8s-client, k8s-cluster, spark-submit or bigdl-submit.",
      )
      parser.add_argument(
          "--backend",
          type=str,
          default="spark",
          choices=("spark", "ray"),
          help="The backend of Orca Estimator, either ray or spark.",
      )
      parser.add_argument(
          "--workers_per_node",
          type=int,
          default=1,
          help="The number of workers on each node.",
      )
      if mode == "train":
          parser.add_argument(
              "--tensorboard",
              action="store_true",
              help="Whether to use TensorBoard as the train callback.",
          )
  
          parser.add_argument(
              "--lr_scheduler",
              action="store_true",
              help="Whether to use learning rate scheduler for training.",
          )
      args = parser.parse_args()
      return args
  
file_path: BigDL/python/orca/tutorial/NCF/utils.py
imports: import os
  import argparse
  import json
  import tempfile
  from bigdl.dllib.utils.file_utils import is_local_path
  from bigdl.orca.data.file import put_local_file_to_remote, get_remote_file_to_local
  from bigdl.orca import init_orca_context, stop_orca_context, OrcaContext
label_desc: Use image node_id 1 for calling a global function with example usage: parse_args(description, mode) and returns: args