code: def load_yaml_test(
      recipe_folder="tests/recipes",
      script_field="Script_file",
      hparam_field="Hparam_file",
      test_field="test_debug_flags",
      filters_fields=[],
      filters=[],
      avoid_list=[],
      rir_folder="tests/tmp/rir",
      data_folder="tests/tmp/yaml",
      output_folder="tests/tmp/",
  ):
      """Tests if the yaml files can be loaded without errors.
  
      Arguments
      ---------
      recipe_folder: path
          Path of the folder containing csv recipe files summarizing all the recipes in the repo.
      script_field: str
          Field of the csv recipe file containing the path of the script to run.
      hparam_field: str
          Field of the csv recipe file containing the path of the hparam file.
      test_field: string
          Field of the csv recipe file containing the test flags.
      filters_fields: list
          This can be used with the "filter" variable
          to run only some tests. For instance, filters_fileds=['Task'] and filters=['ASR'])
          will only run tests for ASR recipes.
      filters: list
          See above.
      avoid_list: list
          List of hparam file not to check.
      rir_folder:
          This overrides the rir_folder; rir_path, and openrir_folder usually specified in the hparam files.
      data_folder:
          This overrides the data_folder usually specified in the hparam files.
      output_folder:
          This overrides the output_folder usually specified in the hparam files.
  
      Returns
      ---------
      check: True
          True if all the hparam files are loaded correctly, False otherwise.
      """
  
      # Get current working directory
      cwd = os.getcwd()
  
      # Set data_foler and output folder
      data_folder = os.path.join(cwd, data_folder)
      output_folder = os.path.join(cwd, output_folder)
      rir_folder = os.path.join(cwd, rir_folder)
  
      # Additional overrides
      add_overrides = {
          "manual_annot_folder": data_folder,
          "musan_folder": data_folder,
          "tea_models_dir": data_folder,
          "wsj_root": data_folder,
          "tokenizer_file": data_folder,
          "commonlanguage_folder": data_folder,
          "tea_infer_dir": data_folder,
          "original_data_folder": data_folder,
          "pretrain_st_dir": data_folder,
          # RIR folder specifications -> all point to the same zip file: one download destination
          "rir_path": rir_folder,
          "rir_folder": rir_folder,
          "openrir_folder": rir_folder,
          "open_rir_folder": rir_folder,
          "data_folder_rirs": rir_folder,
      }
  
      # Additional overrides when extra !PLACEHOLDER are encountered (not: data_folder - output_folder)
      add_placeholder_overrides = {
          "wav2vec2_hub": "facebook/wav2vec2-large-960h-lv60-self",  # this might not hold for all set-ups
          "root_data_folder": data_folder,
          "wav2vec2_folder": f"{output_folder}/wav2vec2_checkpoint",
          # these will need refactoring at some point (recipe-depending values)
          "pretrained_tokenizer_path": "speechbrain/asr-wav2vec2-switchboard",
          "pretrained_lm_tokenizer_path": "speechbrain/asr-transformer-switchboard",
          "channels_path": None,
          "concepts_path": None,
      }
  
      # Read the csv recipe file and detect which tests we have to run
      (
          test_script,
          test_hparam,
          test_flag,
          test_check,
          _,
          _,
      ) = prepare_test(
          recipe_folder,
          script_field,
          hparam_field,
          test_field=test_field,
          filters_fields=filters_fields,
          filters=filters,
      )
  
      check = True
      for i, recipe_id in enumerate(test_script.keys()):
          hparam_file = test_hparam[recipe_id]
          script_file = test_script[recipe_id]
  
          # Changing working folder to recipe folder (as 'run_folder' to avoid name conflict with arg 'recipe_folder')
          script_folder = os.path.dirname(script_file)
          run_folder = os.path.join(cwd, script_folder)
          os.chdir(run_folder)
  
          # Avoid files lister in avoid_list
          if hparam_file in avoid_list:
              print(
                  f"\t({i + 1}/{len(test_script.keys())}) Skipped: {hparam_file}! (check avoid_list for details)"
              )
              continue
  
          print(
              "(%i/%i) Checking %s..."
              % (i + 1, len(test_script.keys()), hparam_file)
          )
  
          # Get absolute path to the hparam file
          hparam_file = os.path.join(cwd, hparam_file)
  
          # Load hyperparameters file with command-line overrides
          overrides = {
              "data_folder": data_folder,
              "output_folder": output_folder,
          }
  
          tag_custom_model = None
          # Append additional overrides when needed
          with open(hparam_file) as f:
              for line in f:
                  # os.chdir(run_folder) is not changing sys.module, and pydoc.locate (in load_hyperpyyaml) fails
                  if "new:custom_model" in line:
                      tag_custom_model = "custom_model"
                      custom_model_from_root = f"{script_folder.replace(os.sep, '.')}.{tag_custom_model}"
                      if (
                          pydoc.locate(custom_model_from_root)
                          is not None
                      ):
                          sys.modules[tag_custom_model] = sys.modules[
                              custom_model_from_root
                          ]
                  # check for !PLACEHOLDER overrides
                  flag_continue = False
                  for key, value in add_placeholder_overrides.items():
                      placeholder_pattern = key + ": !PLACEHOLDER"
                      if (
                          placeholder_pattern in line
                          and line.find(placeholder_pattern) == 0
                      ):
                          overrides.update({key: value})
                          flag_continue = True
  
                  # if !PLACEHOLDER was substituted already, skip further pattern overrides for this line
                  if flag_continue:
                      continue
  
                  # check for additional overrides
                  for key, value in add_overrides.items():
                      pattern = key + ":"
                      if pattern in line and line.find(pattern) == 0:
                          overrides.update({key: value})
  
          with open(hparam_file) as fin:
              try:
                  _ = load_hyperpyyaml(fin, overrides)
              except Exception as e:
                  print("\t" + str(e))
                  check = False
                  print("\tERROR: cannot load %s" % (hparam_file))
          if tag_custom_model is not None:
              if tag_custom_model in sys.modules:
                  del sys.modules[tag_custom_model]
              for tcm_key in list(sys.modules.keys()):
                  if tcm_key.startswith("recipes"):
                      del sys.modules[tcm_key]
      return check
  
file_path: speechbrain/tests/utils/recipe_tests.py
imports: import os
  import re
  import csv
  import sys
  import pydoc
  from time import time
  import subprocess
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.data_utils import download_file
label_desc: Use image node_id 10 for calling a global function with example usage: load_yaml_test(recipe_folder, script_field, hparam_field, test_field, filters_fields, filters, avoid_list, rir_folder, data_folder, output_folder) and returns: check