code: def create_csv(
      orig_csv_file,
      csv_file,
      data_folder,
      accented_letters=False,
      language="darija",
  ):
      """
      Creates the csv file given a list of wav files.
      Arguments
      ---------
      orig_csv_file : str
          Path to the DVoice csv file (standard file).
      data_folder : str
          Path of the DVoice dataset.
      accented_letters : bool, optional
          Defines if accented letters will be kept as individual letters or
          transformed to the closest non-accented letters.
      Returns
      -------
      None
      """
  
      # Check if the given files exists
      if not os.path.isfile(orig_csv_file):
          msg = "\t%s doesn't exist, verify your dataset!" % (
              orig_csv_file
          )
          logger.info(msg)
          raise FileNotFoundError(msg)
  
      # We load and skip the header
      loaded_csv = open(orig_csv_file, "r").readlines()[1:]
      nb_samples = str(len(loaded_csv))
      msg = "Preparing CSV files for %s samples ..." % (str(nb_samples))
      logger.info(msg)
  
      # Adding some Prints
      msg = "Creating csv lists in %s ..." % (csv_file)
      logger.info(msg)
  
      csv_lines = [["ID", "duration", "wav", "spk_id", "wrd"]]
  
      # Start processing lines
      total_duration = 0.0
      for line in tzip(loaded_csv):
          line = line[0]
          # Path is at indice 1 in DVoice csv files. And .mp3 files
          # are located in datasets/lang/clips/
          ALFFA_LANGUAGES = ["amharic", "fongbe"]
          if language in ALFFA_LANGUAGES:
              mp3_path = line.split("\t")[0]
          elif (
              language == "multilingual"
              or language == "swahili"
              or language == "wolof"
          ):
              mp3_path = data_folder + "/" + line.split("\t")[0]
          else:
              mp3_path = data_folder + "/wavs/" + line.split("\t")[0]
  
          file_name = line.split("\t")[0]
          spk_id = line.split("\t")[0].replace(".wav", "")
          snt_id = os.path.basename(file_name)
  
          # Setting torchaudio backend to sox-io (needed to read mp3 files)
          if torchaudio.get_audio_backend() != "sox_io":
              logger.warning(
                  "This recipe needs the sox-io backend of torchaudio"
              )
              logger.warning(
                  "The torchaudio backend is changed to sox_io"
              )
              torchaudio.set_audio_backend("sox_io")
  
          duration = float(line.split("\t")[2])
          total_duration += duration
  
          # Getting transcript
          words = line.split("\t")[1]
  
          # Unicode Normalization
          # words = unicode_normalisation(words)
  
          # !! Language specific cleaning !!
          # Important: feel free to specify the text normalization
          # corresponding to your alphabet.
  
          if language == "dar":
              HAMZA = "\u0621"
              ALEF_MADDA = "\u0622"
              ALEF_HAMZA_ABOVE = "\u0623"
              letters = (
                  "ابتةثجحخدذرزسشصضطظعغفقكلمنهويءآأؤإئ"
                  + HAMZA
                  + ALEF_MADDA
                  + ALEF_HAMZA_ABOVE
              )
              words = re.sub("[^" + letters + "]+", " ", words).upper()
  
          # # Remove accents if specified
          # if not accented_letters:
          #     words = strip_accents(words)
          #     words = words.replace("'", " ")
          #     words = words.replace("’", " ")
  
          # # Remove multiple spaces
          # words = re.sub(" +", " ", words)
  
          # # Remove spaces at the beginning and the end of the sentence
          # words = words.lstrip().rstrip()
  
          # # Getting chars
          # chars = words.replace(" ", "_")
          # chars = " ".join([char for char in chars][:])
  
          # Remove too short sentences (or empty):
          # if len(words.split(" ")) < 3:
          #     continue
  
          # Composition of the csv_line
          csv_line = [
              snt_id,
              str(duration),
              mp3_path,
              spk_id,
              str(words),
          ]
  
          # Adding this line to the csv_lines list
          csv_lines.append(csv_line)
  
      # Writing the csv lines
      with open(csv_file, mode="w", encoding="utf-8") as csv_f:
          csv_writer = csv.writer(
              csv_f,
              delimiter=",",
              quotechar='"',
              quoting=csv.QUOTE_MINIMAL,
          )
  
          for line in csv_lines:
              csv_writer.writerow(line)
  
      # Final prints
      msg = "%s successfully created!" % (csv_file)
      logger.info(msg)
      msg = "Number of samples: %s " % (str(len(loaded_csv)))
      logger.info(msg)
      msg = "Total duration: %s Hours" % (
          str(round(total_duration / 3600, 2))
      )
      logger.info(msg)
  
imports: import os
  import csv
  import re
  import logging
  import torchaudio
  import unicodedata
  from tqdm.contrib import tzip
  import random
  import pandas
  from tqdm import tqdm
  import numpy
  import glob
  from speechbrain.dataio.dataio import read_audio_info
label_desc: Use image node_id 6 for calling a global function with example usage: create_csv(orig_csv_file, csv_file, data_folder, accented_letters, language) without return types