code: def prepare_voxceleb(
      data_folder,
      save_folder,
      verification_pairs_file,
      splits=["train", "dev", "test"],
      split_ratio=[90, 10],
      seg_dur=3.0,
      amp_th=5e-04,
      source=None,
      split_speaker=False,
      random_segment=False,
      skip_prep=False,
  ):
      """
      Prepares the csv files for the Voxceleb1 or Voxceleb2 datasets.
      Please follow the instructions in the README.md file for
      preparing Voxceleb2.
  
      Arguments
      ---------
      data_folder : str
          Path to the folder where the original VoxCeleb dataset is stored.
      save_folder : str
          The directory where to store the csv files.
      verification_pairs_file : str
          txt file containing the verification split.
      splits : list
          List of splits to prepare from ['train', 'dev']
      split_ratio : list
          List if int for train and validation splits
      seg_dur : int
          Segment duration of a chunk in seconds (e.g., 3.0 seconds).
      amp_th : float
          removes segments whose average amplitude is below the
          given threshold.
      source : str
          Path to the folder where the VoxCeleb dataset source is stored.
      split_speaker : bool
          Speaker-wise split
      random_segment : bool
          Train random segments
      skip_prep: Bool
          If True, skip preparation.
  
      Example
      -------
      >>> from recipes.VoxCeleb.voxceleb1_prepare import prepare_voxceleb
      >>> data_folder = 'data/VoxCeleb1/'
      >>> save_folder = 'VoxData/'
      >>> splits = ['train', 'dev']
      >>> split_ratio = [90, 10]
      >>> prepare_voxceleb(data_folder, save_folder, splits, split_ratio)
      """
  
      if skip_prep:
          return
      # Create configuration for easily skipping data_preparation stage
      conf = {
          "data_folder": data_folder,
          "splits": splits,
          "split_ratio": split_ratio,
          "save_folder": save_folder,
          "seg_dur": seg_dur,
          "split_speaker": split_speaker,
      }
  
      if not os.path.exists(save_folder):
          os.makedirs(save_folder)
  
      # Setting output files
      save_opt = os.path.join(save_folder, OPT_FILE)
      save_csv_train = os.path.join(save_folder, TRAIN_CSV)
      save_csv_dev = os.path.join(save_folder, DEV_CSV)
  
      # Create the data folder contains VoxCeleb1 test data from the source
      if source is not None:
          if not os.path.exists(
              os.path.join(data_folder, "wav", "id10270")
          ):
              logger.info(
                  f"Extracting {source}/{TEST_WAV} to {data_folder}"
              )
              shutil.unpack_archive(
                  os.path.join(source, TEST_WAV), data_folder
              )
          if not os.path.exists(os.path.join(data_folder, "meta")):
              logger.info(f"Copying {source}/meta to {data_folder}")
              shutil.copytree(
                  os.path.join(source, "meta"),
                  os.path.join(data_folder, "meta"),
              )
  
      # Check if this phase is already done (if so, skip it)
      if skip(splits, save_folder, conf):
          logger.info(
              "Skipping preparation, completed in previous run."
          )
          return
  
      # Additional checks to make sure the data folder contains VoxCeleb data
      if "," in data_folder:
          data_folder = data_folder.replace(" ", "").split(",")
      else:
          data_folder = [data_folder]
  
      # _check_voxceleb1_folders(data_folder, splits)
  
      msg = "\tCreating csv file for the VoxCeleb Dataset.."
      logger.info(msg)
  
      # Split data into 90% train and 10% validation (verification split)
      wav_lst_train, wav_lst_dev = _get_utt_split_lists(
          data_folder,
          split_ratio,
          verification_pairs_file,
          split_speaker,
      )
  
      # Creating csv file for training data
      if "train" in splits:
          prepare_csv(
              seg_dur,
              wav_lst_train,
              save_csv_train,
              random_segment,
              amp_th,
          )
  
      if "dev" in splits:
          prepare_csv(
              seg_dur, wav_lst_dev, save_csv_dev, random_segment, amp_th
          )
  
      # For PLDA verification
      if "test" in splits:
          prepare_csv_enrol_test(
              data_folder, save_folder, verification_pairs_file
          )
  
      # Saving options (useful to skip this phase when already done)
      save_pkl(conf, save_opt)
  
file_path: speechbrain/recipes/VoxCeleb/SpeakerRec/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 1 for calling a global function with example usage: prepare_voxceleb(data_folder, save_folder, verification_pairs_file, splits, split_ratio, seg_dur, amp_th, source, split_speaker, random_segment, skip_prep) without return types