code: def records_results(params: dict, args: Namespace):
      global search_space_ins, _evaluator, sampler
      from src.tools.io_tools import write_json
      from src.logger import logger
  
      try:
          time_output_file = f"{args.result_dir}/time_score_{args.search_space}_{params['dataset']}_batch_size_{args.batch_size}_{args.device}_{args.tfmem}.json"
          _evaluator.time_usage["io_latency"] = (
              sum(_evaluator.time_usage["track_io_model_load"][2:])
              + sum(
                  _evaluator.time_usage[
                      "track_io_model_release_each_50"
                  ]
              )
              + sum(_evaluator.time_usage["track_io_model_init"][2:])
              + sum(_evaluator.time_usage["track_io_res_load"][2:])
              + sum(
                  _evaluator.time_usage["track_io_data_retrievel"][2:]
              )
              + sum(
                  _evaluator.time_usage["track_io_data_preprocess"][2:]
              )
          )
  
          _evaluator.time_usage["compute_latency"] = sum(
              _evaluator.time_usage["track_compute"][2:]
          )
          _evaluator.time_usage["latency"] = (
              _evaluator.time_usage["io_latency"]
              + _evaluator.time_usage["compute_latency"]
          )
  
          _evaluator.time_usage[
              "avg_compute_latency"
          ] = _evaluator.time_usage["compute_latency"] / len(
              _evaluator.time_usage["track_compute"][2:]
          )
  
          logger.info(f"Saving time usag to {time_output_file}")
          # compute time
          write_json(time_output_file, _evaluator.time_usage)
      except:
          logger.info(
              orjson.dumps({"Errored": traceback.format_exc()}).decode(
                  "utf-8"
              )
          )
  
          return orjson.dumps(
              {"Errored": traceback.format_exc()}
          ).decode("utf-8")
  
      return orjson.dumps({"Done": 1}).decode("utf-8")
  
imports: import calendar
  import os
  import time
  import requests
  import json
  from typing import List, Dict
  import traceback
  import orjson
  from argparse import Namespace
  from shared_config import parse_config_arguments
  from torch.utils.data import Dataset
  import torch
label_desc: Use image node_id 17 for calling a global function with example usage: records_results(params, args) and returns: orjson, orjson