code: def parse_args():
      parser = argparse.ArgumentParser(
          description="Benchmark xgboost/lightgbm/random forest on real datasets"
      )
      parser.add_argument(
          "-dataset",
          default="all",
          type=str,
          help="The dataset to be used for benchmarking. 'all' for all datasets: "
          "fraud, epsilon, year, covtype, higgs, airline",
      )
      parser.add_argument(
          "-datadir",
          default=os.path.join(ROOT_PATH, "benchmarks/trees/datasets/"),
          type=str,
          help="The root datasets folder",
      )
      parser.add_argument(
          "-modeldir",
          default=os.path.join(ROOT_PATH, "benchmarks/trees/models/"),
          type=str,
          help="The root models folder",
      )
      parser.add_argument(
          "-operator",
          default="all",
          type=str,
          help=(
              "Comma-separated list of operators to run; 'all' run rf, xgb and lgbm"
          ),
      )
      parser.add_argument(
          "-backend",
          default="all",
          type=str,
          help=(
              "Comma-separated list of frameworks to run against the baselines;"
              "'all' run onnx-ml, hb-pytorch, hb-torchscript"
          ),
      )
      parser.add_argument(
          "-cpus",
          default=6,
          type=int,
          help=(
              "#CPUs to use for the benchmarks; 0 means psutil.cpu_count(logical=False)"
          ),
      )
      parser.add_argument(
          "-batch_size",
          default=10000,
          type=int,
          help=(
              "Supported batch size. By default we score one record at a time."
          ),
      )
      parser.add_argument(
          "-gpu",
          default=False,
          action="store_true",
          help=(
              "Whether to run scoring on GPU (for the supported frameworks) or not"
          ),
      )
      parser.add_argument(
          "-output",
          default=None,
          type=str,
          help="Output json file with runtime/accuracy stats",
      )
      parser.add_argument(
          "-ntrees",
          default=500,
          type=int,
          help=(
              "Number of trees. Default is as specified in "
              "the respective dataset configuration"
          ),
      )
      parser.add_argument(
          "-nrows",
          default=None,
          type=int,
          help=(
              "Subset of rows in the datasets to use. Useful for test running "
              "benchmarks on small amounts of data. WARNING: Some datasets will "
              "give incorrect accuracy results if nrows is specified as they have "
              "predefined train/test splits."
          ),
      )
      parser.add_argument(
          "-niters",
          default=5,
          type=int,
          help=("Number of iterations for each experiment"),
      )
      parser.add_argument(
          "-batch_benchmark",
          default=False,
          action="store_true",
          help=(
              "Whether to do a single batch benchmark with specified batch_size and niters (not on the whole data)"
          ),
      )
      parser.add_argument(
          "-max_depth",
          default=8,
          type=int,
          help=("Maxmimum number of levels in the trees"),
      )
      parser.add_argument(
          "-validate",
          default=False,
          action="store_true",
          help="Validate prediction output and fails accordingly.",
      )
      parser.add_argument(
          "-extra",
          default="{}",
          help="Extra arguments as a python dictionary",
      )
      args = parser.parse_args()
      # Default value for output json file.
      if not args.output:
          args.output = "result-{}-{}-{}-{}.json".format(
              "gpu" if args.gpu else args.cpus,
              args.ntrees,
              args.max_depth,
              args.batch_size,
          )
      return args
  
imports: import os
  import sys
  import argparse
  import json
  import ast
  import gc
  import psutil
  import signal
  import pickle
  import numpy
  import warnings
  from pathlib import Path
  from scipy import stats
  from memory_profiler import memory_usage
  import benchmarks.trees.train
  import benchmarks.trees.score
  from benchmarks.trees.metrics import get_metrics
  from benchmarks.datasets import prepare_dataset, LearningTask
  from hummingbird.ml._utils import xgboost_installed, lightgbm_installed, sklearn_installed, onnx_ml_tools_installed, onnx_runtime_installed, tvm_installed
label_desc: Use image node_id 6 for calling a global function with example usage: parse_args() and returns: args