code: def _maybe_convert_sets(target_dir, extracted_data):
      extracted_dir = os.path.join(target_dir, extracted_data)
      # override existing CSV with normalized one
      target_csv_template = os.path.join(
          target_dir,
          ARCHIVE_DIR_NAME
          + "_"
          + ARCHIVE_NAME.replace(".zip", "_{}.csv"),
      )
      if os.path.isfile(target_csv_template):
          return
  
      ogg_root_dir = os.path.join(
          extracted_dir, ARCHIVE_NAME.replace(".zip", "")
      )
  
      # Get audiofile path and transcript for each sentence in tsv
      samples = []
      glob_dir = os.path.join(ogg_root_dir, "**/*.ogg")
      for record in glob(glob_dir, recursive=True):
          record_file = record.replace(ogg_root_dir + os.path.sep, "")
          if record_filter(record_file):
              samples.append(
                  (
                      os.path.join(ogg_root_dir, record_file),
                      os.path.splitext(os.path.basename(record_file))[
                          0
                      ],
                  )
              )
  
      counter = get_counter()
      num_samples = len(samples)
      rows = []
  
      print("Importing ogg files...")
      pool = Pool()
      bar = progressbar.ProgressBar(
          max_value=num_samples, widgets=SIMPLE_BAR
      )
      for i, processed in enumerate(
          pool.imap_unordered(one_sample, samples), start=1
      ):
          counter += processed[0]
          rows += processed[1]
          bar.update(i)
      bar.update(num_samples)
      pool.close()
      pool.join()
  
      with open(
          target_csv_template.format("train"),
          "w",
          encoding="utf-8",
          newline="",
      ) as train_csv_file:  # 80%
          with open(
              target_csv_template.format("dev"),
              "w",
              encoding="utf-8",
              newline="",
          ) as dev_csv_file:  # 10%
              with open(
                  target_csv_template.format("test"),
                  "w",
                  encoding="utf-8",
                  newline="",
              ) as test_csv_file:  # 10%
                  train_writer = csv.DictWriter(
                      train_csv_file, fieldnames=FIELDNAMES
                  )
                  train_writer.writeheader()
                  dev_writer = csv.DictWriter(
                      dev_csv_file, fieldnames=FIELDNAMES
                  )
                  dev_writer.writeheader()
                  test_writer = csv.DictWriter(
                      test_csv_file, fieldnames=FIELDNAMES
                  )
                  test_writer.writeheader()
  
                  for i, item in enumerate(rows):
                      transcript = validate_label(item[2])
                      if not transcript:
                          continue
                      wav_filename = os.path.join(
                          ogg_root_dir, item[0].replace(".ogg", ".wav")
                      )
                      i_mod = i % 10
                      if i_mod == 0:
                          writer = test_writer
                      elif i_mod == 1:
                          writer = dev_writer
                      else:
                          writer = train_writer
                      writer.writerow(
                          dict(
                              wav_filename=wav_filename,
                              wav_filesize=os.path.getsize(
                                  wav_filename
                              ),
                              transcript=transcript,
                          )
                      )
  
      imported_samples = get_imported_samples(counter)
      assert counter["all"] == num_samples
      assert len(rows) == imported_samples
  
      print_import_report(counter, SAMPLE_RATE, MAX_SECS)
  
file_path: DeepSpeech/bin/import_lingua_libre.py
imports: import argparse
  import csv
  import os
  import re
  import subprocess
  import unicodedata
  import zipfile
  from glob import glob
  from multiprocessing import Pool
  import progressbar
  import sox
  from deepspeech_training.util.downloader import SIMPLE_BAR, maybe_download
  from deepspeech_training.util.importers import get_counter, get_imported_samples, get_importers_parser, get_validate_label, print_import_report
  from ds_ctcdecoder import Alphabet
label_desc: Use image node_id 4 for calling a global function with example usage: _maybe_convert_sets(target_dir, extracted_data) without return types