code: def __process_data(
      unzipped_dataset_path,
      metadata,
      min_duration,
      max_duration,
      val_size,
      test_size,
      seed_for_ds_split,
  ):
      logging.info("Preparing JSON train/val/test splits.")
  
      entries = list()
      not_found_wavs = list()
      wrong_duration_wavs = list()
  
      for metadata_fname in metadata:
          meta_file = unzipped_dataset_path / metadata_fname
          with open(meta_file, "r") as fmeta:
              for line in tqdm(fmeta):
                  items = line.strip().split("|")
                  wav_file_stem, text = items[0], items[1]
                  wav_file = (
                      unzipped_dataset_path
                      / "wavs"
                      / f"{wav_file_stem}.wav"
                  )
  
                  # skip audios if they do not exist.
                  if not wav_file.exists():
                      not_found_wavs.append(wav_file)
                      logging.warning(
                          f"Skipping {wav_file}: it is not found."
                      )
                      continue
  
                  # skip audios if their duration is out of range.
                  duration = subprocess.check_output(
                      f"soxi -D {wav_file}", shell=True
                  )
                  duration = float(duration)
                  if min_duration <= duration <= max_duration:
                      entry = {
                          "audio_filepath": str(wav_file),
                          "duration": duration,
                          "text": text,
                      }
                      entries.append(entry)
                  elif duration < min_duration:
                      wrong_duration_wavs.append(wav_file)
                      logging.warning(
                          f"Skipping {wav_file}: it is too short, less than {min_duration} seconds."
                      )
                      continue
                  else:
                      wrong_duration_wavs.append(wav_file)
                      logging.warning(
                          f"Skipping {wav_file}: it is too long, greater than {max_duration} seconds."
                      )
                      continue
  
      random.Random(seed_for_ds_split).shuffle(entries)
      train_size = len(entries) - val_size - test_size
      if train_size <= 0:
          raise ValueError("Not enough data for the train split.")
  
      logging.info("Preparing JSON train/val/test splits is complete.")
      train, val, test = (
          entries[:train_size],
          entries[train_size : train_size + val_size],
          entries[train_size + val_size :],
      )
  
      return train, val, test, not_found_wavs, wrong_duration_wavs
  
file_path: NeMo/scripts/dataset_processing/tts/thorsten_neutral/get_data.py
imports: import argparse
  import json
  import random
  import shutil
  import subprocess
  import urllib.request
  from pathlib import Path
  from joblib import Parallel, delayed
  from tqdm import tqdm
  from nemo.utils import logging
label_desc: Use image node_id 6 for calling a global function with example usage: __process_data(unzipped_dataset_path, metadata, min_duration, max_duration, val_size, test_size, seed_for_ds_split) and returns: train,  val,  test,  not_found_wavs,  wrong_duration_wavs