code: def start_one_worker(
      queue, args, worker_id, my_partition, search_space_ins, res
  ):
      from src.tools.io_tools import write_json, read_json
  
      gmt = time.gmtime()
      ts = calendar.timegm(gmt)
  
      os.environ.setdefault(
          "log_file_name",
          f"{args.log_name}_{args.dataset}_wkid_{worker_id}_{ts}.log",
      )
      # import logging
      logger = logging.getLogger(
          f"{args.dataset}_wkid_{worker_id}_{ts}"
      )
      if not os.path.exists(f"./{args.log_folder}"):
          os.makedirs(f"./{args.log_folder}")
      handler = logging.FileHandler(
          f"./{args.log_folder}/{args.log_name}_{args.dataset}_wkid_{worker_id}_{ts}.log"
      )
      formatter = logging.Formatter(
          "%(asctime)s - %(levelname)s - %(message)s"
      )
      handler.setFormatter(formatter)
      logger.addHandler(handler)
      from src.eva_engine.phase2.algo.trainer import ModelTrainer
  
      if args.total_models_per_worker is None:
          logger.info(
              f" ---- begin exploring, current worker have  "
              f"{len(my_partition)} models. explore all those models "
          )
      else:
          logger.info(
              f" ---- begin exploring, current worker have  "
              f"{len(my_partition)} models. but explore {args.total_models_per_worker} models "
          )
  
      train_loader, val_loader, test_loader = queue.get()
  
      checkpoint_file_name = f"./base_line_res_{args.dataset}/train_baseline_{args.dataset}_wkid_{worker_id}.json"
      visited = read_json(checkpoint_file_name)
      if visited == {}:
          visited = {args.dataset: {}}
          logger.info(
              f" ---- initialize checkpointing with {visited} . "
          )
      else:
          logger.info(
              f" ---- recovery from checkpointing with {len(visited[args.dataset])} model. "
          )
  
      explored_arch_num = 0
      for arch_index in my_partition:
          print(f"begin to train the {arch_index}")
          model = search_space_ins.new_architecture(res[arch_index]).to(
              args.device
          )
          (
              valid_auc,
              total_run_time,
              train_log,
          ) = ModelTrainer.fully_train_arch(
              model=model,
              use_test_acc=False,
              epoch_num=args.epoch,
              train_loader=train_loader,
              val_loader=val_loader,
              test_loader=test_loader,
              args=args,
              logger=logger,
          )
  
          logger.info(
              f" ----- model id: {res[arch_index]}, Val_AUC : {valid_auc} Total running time: "
              f"{total_run_time}-----"
          )
  
          # update the shared model eval res
          logger.info(f" ---- exploring {explored_arch_num} model. ")
          logger.info(
              f" ---- info: {json.dumps({res[arch_index]: train_log})}"
          )
          visited[args.dataset][res[arch_index]] = train_log
          explored_arch_num += 1
  
          if (
              args.total_models_per_worker is not None
              and explored_arch_num > args.total_models_per_worker
          ):
              break
  
          logger.info(f" Saving result to: {checkpoint_file_name}")
          write_json(checkpoint_file_name, visited)
  
file_path: singa/examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/exps/nas_bench_tabular/2.seq_train_dist_online.py
imports: import argparse
  import calendar
  import json
  import logging
  import os
  import time
  from exps.shared_args import parse_arguments
label_desc: Use image node_id 2 for calling a global function with example usage: start_one_worker(queue, args, worker_id, my_partition, search_space_ins, res) without return types