code: def check_ksponspeech_folders(data_folder, splits):
      """
      Check if the data folder actually contains the ksponspeech dataset.
  
      If it does not, an error is raised.
  
      Returns
      -------
      None
  
      Raises
      ------
      OSError
          If ksponspeech is not found at the specified path.
      """
      # Checking if all the splits exist
  
      for split in splits:
          if split not in ["eval_other", "eval_clean", "train", "dev"]:
              raise ValueError("Unsupported data split")
  
          if "eval" in split:
              trn_folder = os.path.join(data_folder, split + ".trn")
              if not os.path.exists(trn_folder):
                  err_msg = (
                      "the file %s does not exist (it is expected in the "
                      "ksponspeech dataset)" % trn_folder
                  )
                  raise OSError(err_msg)
  
          elif split == "dev":
              trn_folder = os.path.join(data_folder, "train.trn")
              if not os.path.exists(trn_folder):
                  err_msg = (
                      "the file %s does not exist (it is expected in the "
                      "ksponspeech dataset)" % trn_folder
                  )
                  raise OSError(err_msg)
  
          elif split == "train":
              trn_folder = os.path.join(data_folder, "train.trn")
              if not os.path.exists(trn_folder):
                  err_msg = (
                      "the file %s does not exist (it is expected in the "
                      "ksponspeech dataset)" % trn_folder
                  )
                  raise OSError(err_msg)
  
          dirs = split2dirs(split)
  
          for dir in dirs:
              dir_folder = os.path.join(data_folder, dir)
              if not os.path.exists(dir_folder):
                  err_msg = (
                      "the file %s does not exist (it is expected in the "
                      "ksponspeech dataset)" % dir_folder
                  )
                  raise OSError(err_msg)
  
file_path: speechbrain/recipes/KsponSpeech/ASR/transformer/ksponspeech_prepare.py
imports: import csv
  import logging
  import os
  import re
  import torchaudio
  from speechbrain.dataio.dataio import load_pkl, merge_csvs, save_pkl
  from speechbrain.utils.data_utils import get_all_files
label_desc: Use image node_id 7 for calling a global function with example usage: check_ksponspeech_folders(data_folder, splits) without return types