code: def experiment(args, records):
      path = os.path.abspath(os.path.dirname(__file__))
      model_path = os.path.join(path, args.ckpt)
  
      if args.framework == "tensorflow":
          import tensorflow as tf
  
          tf.config.threading.set_inter_op_parallelism_threads(1)
          tf.config.threading.set_intra_op_parallelism_threads(
              args.cores
          )
          if not os.path.exists(model_path):
              os.makedirs(model_path, exist_ok=True)
  
      # generate data
      train_loader, val_loader, test_loader = generate_data(args)
  
      # initialize forecaster
      forecaster = generate_forecaster(args)
  
      # running stage
      if args.stage == "train":
          train(args, model_path, forecaster, train_loader, records)
      elif args.stage == "latency":
          latency(
              args,
              model_path,
              forecaster,
              train_loader,
              test_loader,
              records,
          )
      elif args.stage == "throughput":
          throughput(
              args,
              model_path,
              forecaster,
              train_loader,
              test_loader,
              records,
          )
      elif args.stage == "accuracy":
          accuracy(
              args,
              records,
              forecaster,
              train_loader,
              val_loader,
              test_loader,
          )
  
      # print results
      get_CPU_info()
      check_nano_env()
      result(args, records)
  
file_path: BigDL/python/chronos/src/bigdl/chronos/benchmark/benchmark_chronos.py
imports: from bigdl.chronos.benchmark import generate_forecaster, generate_data, get_CPU_info, check_nano_env
  import time
  import numpy
  import argparse
  import os
  from scipy import stats
  import psutil
  import subprocess
  from bigdl.nano.utils.common import invalidInputError
  from bigdl.nano.utils.common import spawn_new_process
label_desc: Use image node_id 6 for calling a global function with example usage: experiment(args, records) without return types