code: def write_experiments(exps: list, exps_dir: str):
      exp_paths = []
      for exp in exps:
          exp_name = exp["name"]
          # write the expr config to a json file
          exp_path = os.path.join(exps_dir, f"{exp_name}.json")
          with open(exp_path, "w") as fd:
              json.dump(exp, fd)
              exp_paths.append(exp_path)
      return exp_paths
  
imports: import re
  import collections.abc
  import os
  import json
  from deepspeed.runtime.constants import GRADIENT_ACCUMULATION_STEPS, TRAIN_MICRO_BATCH_SIZE_PER_GPU
  import itertools
  import copy
  from ..utils import logger
label_desc: Use image node_id 20 for calling a global function with example usage: write_experiments(exps, exps_dir) and returns: exp_paths