code: def split_lexicon(data_folder, split_ratio):
      """
      Splits the lexicon.csv file into train, validation, and test csv files
  
      Arguments
      ---------
      data_folder : str
          Path to the folder containing the lexicon.csv file to split.
      split_ratio : list
          List containing the training, validation, and test split ratio. Set it
          to [80, 10, 10] for having 80% of material for training, 10% for valid,
          and 10 for test.
  
      Returns
      -------
      None
      """
      # Reading lexicon.csv
      lexicon_csv_path = os.path.join(data_folder, "lexicon.csv")
      with open(lexicon_csv_path, "r") as f:
          lexicon_lines = f.readlines()
      # Remove header
      lexicon_lines = lexicon_lines[1:]
  
      # Shuffle entries
      random.shuffle(lexicon_lines)
  
      # Selecting lines
      header = "ID,duration,char,phn\n"
  
      tr_snts = int(0.01 * split_ratio[0] * len(lexicon_lines))
      train_lines = [header] + lexicon_lines[0:tr_snts]
      valid_snts = int(0.01 * split_ratio[1] * len(lexicon_lines))
      valid_lines = [header] + lexicon_lines[
          tr_snts : tr_snts + valid_snts
      ]
      test_lines = [header] + lexicon_lines[tr_snts + valid_snts :]
  
      # Saving files
      with open(os.path.join(data_folder, "lexicon_tr.csv"), "w") as f:
          f.writelines(train_lines)
      with open(os.path.join(data_folder, "lexicon_dev.csv"), "w") as f:
          f.writelines(valid_lines)
      with open(
          os.path.join(data_folder, "lexicon_test.csv"), "w"
      ) as f:
          f.writelines(test_lines)
  
file_path: speechbrain/recipes/LibriSpeech/G2P/librispeech_prepare.py
imports: import os
  import csv
  import random
  from collections import Counter
  from dataclasses import dataclass
  import functools
  import logging
  from speechbrain.utils.data_utils import download_file, get_all_files
  from speechbrain.dataio.dataio import load_pkl, save_pkl, merge_csvs, read_audio_info
  from speechbrain.utils.parallel import parallel_map
label_desc: Use image node_id 3 for calling a global function with example usage: split_lexicon(data_folder, split_ratio) without return types