code: def fetch_from_db(space_name, dataset, run_id_m, N_m):
      """
      :param run_id_m: run_id 100 max
      :param B1_m: number of models evaluted
      :return:
      """
      global con
      global cur
      if con is None:
          if space_name == Config.NB201:
              if dataset == Config.c10:
                  tf_smt_used = tf_smt_file_NB201C10
              elif dataset == Config.c100:
                  tf_smt_used = tf_smt_file_NB201C100
              elif dataset == Config.imgNet:
                  tf_smt_used = tf_smt_file_NB201Img
              else:
                  print(f"{dataset} is Not implemented")
                  raise
          elif space_name == Config.NB101:
              if dataset == Config.c10:
                  tf_smt_used = tf_smt_file_NB101C10
              else:
                  print(f"{dataset}Not implemented")
                  raise
          else:
              print(f"{space_name} is Not implemented")
              raise
  
          print(tf_smt_used)
          con = sqlite3.connect(tf_smt_used)
          cur = con.cursor()
  
      res = cur.execute(
          "SELECT * FROM simulateExp WHERE run_num = {} and model_explored = {}".format(
              run_id_m, N_m
          )
      )
      fetch_res = res.fetchone()
  
      try:
          arch_id = fetch_res[2]
          candidates = json.loads(fetch_res[3])
          current_time = float(fetch_res[4])
      except:
          print(traceback.format_exc())
          raise f"res is None when using run_id ={run_id_m} and bm = {N_m}"
  
      return arch_id, candidates, current_time
  
imports: import json
  import os
  import sqlite3
  import traceback
  from src.common.constant import Config
label_desc: Use image node_id 1 for calling a global function with example usage: fetch_from_db(space_name, dataset, run_id_m, N_m) and returns: arch_id,  candidates,  current_time