code: def write2csv(
      language,
      clean_fullpaths,
      noise_fullpaths,
      noisy_fullpaths,
      csv_file,
      fs=16000,
  ):
      """
      Write data to CSV file in an appropriate format.
  
      Arguments
      ---------
      language : str
          Language of audio file
      clean_fullpaths : str
          Path to clean audio files of a split in the train/valid-set
      noise_fullpaths : str
          Path to noise audio files of a split in the train/valid-set
      noisy_fullpaths : str
          Path to noisy audio files of a split in the train/valid-set
      csv_file : str
          Save csv_file path for prepared data.
      fs : int
          Sampling rate. Defaults to 16000.
      """
      csv_columns = [
          "ID",
          "language",
          "duration",
          "clean_wav",
          "clean_wav_format",
          "clean_wav_opts",
          "noise_wav",
          "noise_wav_format",
          "noise_wav_opts",
          "noisy_wav",
          "noisy_wav_format",
          "noisy_wav_opts",
      ]
  
      # Retreive duration of just one signal. It is assumed
      # that all files have the same duration in MS-DNS dataset.
  
      total_duration = 0
      with open(csv_file, "w") as csvfile:
          writer = csv.DictWriter(csvfile, fieldnames=csv_columns)
          writer.writeheader()
  
          for (
              i,
              (lang, clean_fp, noise_fp, noisy_fp),
          ) in enumerate(
              tqdm(
                  zip(
                      language,
                      clean_fullpaths,
                      noise_fullpaths,
                      noisy_fullpaths,
                  )
              )
          ):
              signal = read_audio(clean_fp)
              duration = signal.shape[0] / fs
              total_duration += duration
  
              row = {
                  "ID": i,
                  "language": lang,
                  "duration": duration,
                  "clean_wav": clean_fp,
                  "clean_wav_format": "wav",
                  "clean_wav_opts": None,
                  "noise_wav": noise_fp,
                  "noise_wav_format": "wav",
                  "noise_wav_opts": None,
                  "noisy_wav": noisy_fp,
                  "noisy_wav_format": "wav",
                  "noisy_wav_opts": None,
              }
              writer.writerow(row)
  
      # Final prints
      msg = "%s successfully created!" % (csv_file)
      logger.info(msg)
      msg = "Number of samples: %s " % (str(len(clean_fullpaths)))
      logger.info(msg)
      msg = "Total duration: %s Hours" % (
          str(round(total_duration / 3600, 2))
      )
      logger.info(msg)
  
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 5 for calling a global function with example usage: write2csv(language, clean_fullpaths, noise_fullpaths, noisy_fullpaths, csv_file, fs) without return types