code: def _generate_configurations(config: TextIO) -> List[Any]:
      # First, we parse the config file
      options = yaml.safe_load(config)
      seeds = options["seeds"]
      datasets = options["datasets"]
  
      def process_key(model: str, key: str) -> str:
          if key in TrainConfig.training_hyperparameters():
              return key
          return f"{model}_{key}"
  
      configs = explode_key_values(
          "model", options["models"], process_key
      )
  
      # Explode all runs and save to file
      all_configurations = []
      for seed in seeds:
          for dataset in datasets:
              for model_config in configs:
                  all_configurations.append(
                      {
                          "seed": seed,
                          "dataset": dataset,
                          **model_config,
                      }
                  )
  
      return all_configurations
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/cli/utils/config.py
imports: import itertools
  from pathlib import Path
  from typing import Any, Callable, Dict, Iterator, List, Literal, TextIO
  import yaml
  from tsbench.config import TrainConfig
label_desc: Use image node_id 4 for calling a global function with example usage: _generate_configurations(config) and returns: all_configurations, model, str, key, key