code: def prepare_csv_enrol_test(
      data_folders, save_folder, verification_pairs_file
  ):
      """
      Creates the csv file for test data (useful for verification)
  
      Arguments
      ---------
      data_folder : str
          Path of the data folders
      save_folder : str
          The directory where to store the csv files.
  
      Returns
      -------
      None
      """
  
      # msg = '\t"Creating csv lists in  %s..."' % (csv_file)
      # logger.debug(msg)
  
      csv_output_head = [
          ["ID", "duration", "wav", "start", "stop", "spk_id"]
      ]  # noqa E231
  
      for data_folder in data_folders:
          test_lst_file = verification_pairs_file
  
          enrol_ids, test_ids = [], []
  
          # Get unique ids (enrol and test utterances)
          for line in open(test_lst_file):
              e_id = line.split(" ")[1].rstrip().split(".")[0].strip()
              t_id = line.split(" ")[2].rstrip().split(".")[0].strip()
              enrol_ids.append(e_id)
              test_ids.append(t_id)
  
          enrol_ids = list(np.unique(np.array(enrol_ids)))
          test_ids = list(np.unique(np.array(test_ids)))
  
          # Prepare enrol csv
          logger.info("preparing enrol csv")
          enrol_csv = []
          for id in enrol_ids:
              wav = data_folder + "/wav/" + id + ".wav"
  
              # Reading the signal (to retrieve duration in seconds)
              signal, fs = torchaudio.load(wav)
              signal = signal.squeeze(0)
              audio_duration = signal.shape[0] / SAMPLERATE
              start_sample = 0
              stop_sample = signal.shape[0]
              [spk_id, sess_id, utt_id] = wav.split("/")[-3:]
  
              csv_line = [
                  id,
                  audio_duration,
                  wav,
                  start_sample,
                  stop_sample,
                  spk_id,
              ]
  
              enrol_csv.append(csv_line)
  
          csv_output = csv_output_head + enrol_csv
          csv_file = os.path.join(save_folder, ENROL_CSV)
  
          # Writing the csv lines
          with open(csv_file, mode="w") as csv_f:
              csv_writer = csv.writer(
                  csv_f,
                  delimiter=",",
                  quotechar='"',
                  quoting=csv.QUOTE_MINIMAL,
              )
              for line in csv_output:
                  csv_writer.writerow(line)
  
          # Prepare test csv
          logger.info("preparing test csv")
          test_csv = []
          for id in test_ids:
              wav = data_folder + "/wav/" + id + ".wav"
  
              # Reading the signal (to retrieve duration in seconds)
              signal, fs = torchaudio.load(wav)
              signal = signal.squeeze(0)
              audio_duration = signal.shape[0] / SAMPLERATE
              start_sample = 0
              stop_sample = signal.shape[0]
              [spk_id, sess_id, utt_id] = wav.split("/")[-3:]
  
              csv_line = [
                  id,
                  audio_duration,
                  wav,
                  start_sample,
                  stop_sample,
                  spk_id,
              ]
  
              test_csv.append(csv_line)
  
          csv_output = csv_output_head + test_csv
          csv_file = os.path.join(save_folder, TEST_CSV)
  
          # Writing the csv lines
          with open(csv_file, mode="w") as csv_f:
              csv_writer = csv.writer(
                  csv_f,
                  delimiter=",",
                  quotechar='"',
                  quoting=csv.QUOTE_MINIMAL,
              )
              for line in csv_output:
                  csv_writer.writerow(line)
  
file_path: speechbrain/recipes/VoxCeleb/voxceleb_prepare.py
imports: import os
  import csv
  import logging
  import glob
  import random
  import shutil
  import sys
  import numpy
  import torch
  import torchaudio
  from tqdm.contrib import tqdm
  from speechbrain.dataio.dataio import load_pkl, save_pkl
label_desc: Use image node_id 7 for calling a global function with example usage: prepare_csv_enrol_test(data_folders, save_folder, verification_pairs_file) without return types