code: def run_experiments(
      dataset=None,
      model=None,
      method=None,
      metric=None,
      cache_dir="/tmp",
      nworkers=1,
  ):
      experiments_arr = list(
          experiments(
              dataset=dataset, model=model, method=method, metric=metric
          )
      )
      if nworkers == 1:
          out = list(
              map(
                  run_experiments_helper,
                  zip(experiments_arr, itertools.repeat(cache_dir)),
              )
          )
      else:
          with Pool(nworkers) as pool:
              out = pool.map(
                  run_experiments_helper,
                  zip(experiments_arr, itertools.repeat(cache_dir)),
              )
      return list(zip(experiments_arr, out))
  
imports: import copy
  import itertools
  import os
  import pickle
  import random
  import subprocess
  import sys
  import time
  from multiprocessing import Pool
  from ..None import __version__, datasets
  from .None import metrics, models
  from threading import Lock, Thread
label_desc: Use image node_id 4 for calling a global function with example usage: run_experiments(dataset, model, method, metric, cache_dir, nworkers) and returns: list