code: def run_tasks(config_list, expdir_list):
      controller = ClusterController(config_list)
      result_list = [None for _ in expdir_list]
  
      queue = Queue()
      for idx, expdir in enumerate(expdir_list):
          queue.put([idx, expdir])
      print("Here Check 10 yy")
      remained = len(result_list)
      print(remained)
      while remained > 0:
          idx, val = queue.get()
          print(idx)
          print(val)
          print("Here Check 11 yy")
          if isinstance(val, str):
              # expdir, need to execute
              print("Here Check 14 yy")
              controller.execute(idx, val, queue)
              print("Here Check 15 yy")
          elif isinstance(val, tuple):
              # result, need to be put in result_list
              result_list[idx] = val
              remained -= 1
              print("Here Check 16 yy")
      return result_list
  
imports: from subprocess import Popen, PIPE
  from threading import Thread, Lock
  from queue import Queue
  from time import sleep
  from sys import stderr
  import re
  import json
label_desc: Use image node_id 1 for calling a global function with example usage: run_tasks(config_list, expdir_list) and returns: result_list