code: def prepare_RescueSpeech(
      data_folder,
      save_folder,
      train_tsv_file=None,
      dev_tsv_file=None,
      test_tsv_file=None,
      accented_letters=False,
      skip_prep=False,
      sample_rate=16000,
      task="asr",
  ):
      """
      Prepares the csv files for RescueSpeech audio data.
  
      Arguments
      ---------
      data_folder : str
          Path to the folder where the original dataset is stored.
      save_folder : str
          The directory where to store the csv files.
      train_tsv_file : str, optional
          Path to the Train RescueSpeech .tsv file (cs)
      dev_tsv_file : str, optional
          Path to the Dev RescueSpeech .tsv file (cs)
      test_tsv_file : str, optional
          Path to the Test RescueSpeech .tsv file (cs)
      accented_letters : bool, optional
          Defines if accented letters will be kept as individual letters or
          transformed to the closest non-accented letters.
      skip_prep: bool
          If True, skip data preparation.
      sample_rate: int, optional
          Sample rate of the wav files.
      task: str, optional
          States the task for which data prepration is being done.
          It can either be 'asr' or 'enhance'
  
      """
  
      if skip_prep:
          return
  
      # If not specified point toward standard location
      if train_tsv_file is None:
          train_tsv_file = data_folder + "/train.tsv"
      else:
          train_tsv_file = train_tsv_file
  
      if dev_tsv_file is None:
          dev_tsv_file = data_folder + "/dev.tsv"
      else:
          dev_tsv_file = dev_tsv_file
  
      if test_tsv_file is None:
          test_tsv_file = data_folder + "/test.tsv"
      else:
          test_tsv_file = test_tsv_file
  
      # Setting the save folder
      if not os.path.exists(save_folder):
          os.makedirs(save_folder)
  
      # Setting ouput files
      save_csv_train = save_folder + "/train.csv"
      save_csv_dev = save_folder + "/dev.csv"
      save_csv_test = save_folder + "/test.csv"
  
      # If csv already exists, we skip the data preparation
      if skip(save_csv_train, save_csv_dev, save_csv_test):
          msg = "%s already exists, skipping data preparation!" % (
              save_csv_train
          )
          logger.info(msg)
  
          msg = "%s already exists, skipping data preparation!" % (
              save_csv_dev
          )
          logger.info(msg)
  
          msg = "%s already exists, skipping data preparation!" % (
              save_csv_test
          )
          logger.info(msg)
  
          return
  
      # Additional checks to make sure the data folder contains RescueSpeech data.
      check_RescueSpeech_data_folders(data_folder)
  
      # Creating csv files for {train, dev, test} data
      file_pairs = zip(
          [train_tsv_file, dev_tsv_file, test_tsv_file],
          [save_csv_train, save_csv_dev, save_csv_test],
      )
      if task == "asr":
          for tsv_file, save_csv in file_pairs:
              # Prepare CSV files
              create_asr_csv(
                  tsv_file, save_csv, data_folder, accented_letters
              )
      elif task == "enhance":
          create_enhance_csv(
              data_folder, save_csv_train, "train", sample_rate
          )
          create_enhance_csv(
              data_folder, save_csv_dev, "valid", sample_rate
          )
          create_enhance_csv(
              data_folder, save_csv_test, "test", sample_rate
          )
  
file_path: speechbrain/recipes/RescueSpeech/ASR/noise-robust/rescuespeech_prepare.py
imports: import os
  import re
  import csv
  import glob
  import logging
  import torchaudio
  import unicodedata
  from tqdm import tqdm
  from tqdm.contrib import tzip
  from speechbrain.dataio.dataio import read_audio
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_RescueSpeech(data_folder, save_folder, train_tsv_file, dev_tsv_file, test_tsv_file, accented_letters, skip_prep, sample_rate, task) without return types