code: def one_sample(sample):
      file_size = -1
      frames = 0
  
      audio_source = sample[0]
      target_dir = sample[1]
      dataset_basename = sample[2]
  
      start_time = sample[3]
      duration = sample[4]
      label = label_filter_fun(sample[5])
      sample_id = sample[6]
  
      _wav_filename = os.path.basename(
          audio_source.replace(".wav", "_{:06}.wav".format(sample_id))
      )
      wav_fullname = os.path.join(
          target_dir, dataset_basename, _wav_filename
      )
  
      if not os.path.exists(wav_fullname):
          subprocess.check_output(
              [
                  "ffmpeg",
                  "-i",
                  audio_source,
                  "-ss",
                  str(start_time),
                  "-t",
                  str(duration),
                  "-c",
                  "copy",
                  wav_fullname,
              ],
              stdin=subprocess.DEVNULL,
              stderr=subprocess.STDOUT,
          )
  
      file_size = os.path.getsize(wav_fullname)
      frames = int(
          subprocess.check_output(
              ["soxi", "-s", wav_fullname], stderr=subprocess.STDOUT
          )
      )
  
      _counter = get_counter()
      _rows = []
  
      if file_size == -1:
          # Excluding samples that failed upon conversion
          _counter["failed"] += 1
      elif label is None:
          # Excluding samples that failed on label validation
          _counter["invalid_label"] += 1
      elif int(frames / SAMPLE_RATE * 1000 / 10 / 2) < len(str(label)):
          # Excluding samples that are too short to fit the transcript
          _counter["too_short"] += 1
      elif frames / SAMPLE_RATE < MIN_SECS:
          # Excluding samples that are too short
          _counter["too_short"] += 1
      elif frames / SAMPLE_RATE > MAX_SECS:
          # Excluding very long samples to keep a reasonable batch-size
          _counter["too_long"] += 1
      else:
          # This one is good - keep it for the target CSV
          _rows.append(
              (
                  os.path.join(dataset_basename, _wav_filename),
                  file_size,
                  label,
              )
          )
          _counter["imported_time"] += frames
      _counter["all"] += 1
      _counter["total_time"] += frames
  
      return (_counter, _rows)
  
imports: import csv
  import sys
  import os
  import progressbar
  import subprocess
  import zipfile
  from glob import glob
  from multiprocessing import Pool
  import hashlib
  import decimal
  import math
  import unicodedata
  import re
  import sox
  import xml.etree.ElementTree
  import requests
  import json
  from deepspeech_training.util.downloader import SIMPLE_BAR, maybe_download
  from deepspeech_training.util.helpers import secs_to_hours
  from deepspeech_training.util.importers import get_counter, get_importers_parser, get_imported_samples, get_validate_label, print_import_report
  from ds_ctcdecoder import Alphabet
label_desc: Use image node_id 8 for calling a global function with example usage: one_sample(sample) and returns: _counter,  _rows