code: def _maybe_convert_sets(
      target_dir, extracted_data, english_compatible=False
  ):
      extracted_dir = os.path.join(target_dir, extracted_data)
      # override existing CSV with normalized one
      target_csv_template = os.path.join(
          target_dir, "ts_" + ARCHIVE_NAME + "_{}.csv"
      )
      if os.path.isfile(target_csv_template):
          return
      path_to_original_csv = os.path.join(extracted_dir, "data.csv")
      with open(path_to_original_csv) as csv_f:
          data = [
              d
              for d in csv.DictReader(csv_f, delimiter=",")
              if float(d["duration"]) <= MAX_SECS
          ]
  
      for line in data:
          line["path"] = os.path.join(extracted_dir, line["path"])
  
      num_samples = len(data)
      rows = []
      counter = get_counter()
  
      print("Importing {} wav files...".format(num_samples))
      pool = Pool()
      bar = progressbar.ProgressBar(
          max_value=num_samples, widgets=SIMPLE_BAR
      )
      for i, processed in enumerate(
          pool.imap_unordered(one_sample, data), 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(
                          cleanup_transcript(
                              item[2],
                              english_compatible=english_compatible,
                          )
                      )
                      if not transcript:
                          continue
                      wav_filename = os.path.join(
                          target_dir, extracted_data, item[0]
                      )
                      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_ts.py
imports: import csv
  import os
  import re
  import subprocess
  import zipfile
  from multiprocessing import Pool
  import progressbar
  import sox
  import unidecode
  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
label_desc: Use image node_id 4 for calling a global function with example usage: _maybe_convert_sets(target_dir, extracted_data, english_compatible) without return types