code: def gen_grid(args, config, config_budget={}):
      task_name = (
          f"{get_fname(args.config)}_grid_{get_fname(args.grid)}"
      )
      fname_start = get_fname(args.config)
      out_dir = f"{args.out_dir}/{task_name}"
      makedirs_rm_exist(out_dir)
      config["out_dir"] = osp.join(config["out_dir"], task_name)
  
      outs = load_search_file(args.grid)
      for i, out in enumerate(outs):
          vars_label = [row[0].split(".") for row in out]
          vars_alias = [row[1] for row in out]
          vars_value = grid2list(
              [string_to_python(row[2]) for row in out]
          )
          if i == 0:
              print(f"Variable label: {vars_label}")
              print(f"Variable alias: {vars_alias}")
  
          for vars in vars_value:
              config_out = config.copy()
              fname_out = fname_start
              for id, var in enumerate(vars):
                  if len(vars_label[id]) == 1:
                      config_out[vars_label[id][0]] = var
                  elif len(vars_label[id]) == 2:
                      if (
                          vars_label[id][0] in config_out
                      ):  # if key1 exist
                          config_out[vars_label[id][0]][
                              vars_label[id][1]
                          ] = var
                      else:
                          config_out[vars_label[id][0]] = {
                              vars_label[id][1]: var
                          }
                  else:
                      raise ValueError(
                          "Only 2-level config files are supported"
                      )
                  var_repr = str(var).strip("[]").strip("''")
                  fname_out += f"-{vars_alias[id]}={var_repr}"
              if len(config_budget) > 0:
                  config_out = match_baseline_cfg(
                      config_out, config_budget
                  )
              with open(f"{out_dir}/{fname_out}.yaml", "w") as f:
                  yaml.dump(config_out, f, default_flow_style=False)
          print(f"{len(vars_value)} configurations saved to: {out_dir}")
  
file_path: pytorch_geometric/graphgym/configs_gen.py
imports: import argparse
  import copy
  import csv
  import os.path
  import random
  import numpy
  import yaml
  from torch_geometric.graphgym.utils.comp_budget import match_baseline_cfg
  from torch_geometric.graphgym.utils.io import makedirs_rm_exist, string_to_python
label_desc: Use image node_id 10 for calling a global function with example usage: gen_grid(args, config, config_budget) without return types