code: def main():
      args = get_args()
      data_root = args.data_root
      manifests_root = args.manifests_root
      set_type = args.set_type
  
      dataset_root = data_root / f"HUI-Audio-Corpus-German-{set_type}"
      dataset_root.mkdir(parents=True, exist_ok=True)
  
      if set_type == "full":
          data_source = URLS_FULL
          stats_source = URL_STATS_FULL
      elif set_type == "clean":
          data_source = URLS_CLEAN
          stats_source = URL_STATS_CLEAN
      else:
          raise ValueError(
              f"Unknown {set_type}. Please choose either clean or full."
          )
  
      # download and unzip dataset stats
      zipped_stats_path = dataset_root / Path(stats_source).name
      __maybe_download_file(stats_source, zipped_stats_path)
      __extract_file(zipped_stats_path, dataset_root)
  
      # download datasets
      # Note: you need to verify which backend works well on your cluster.
      # backend="loky" is fine on multi-core Ubuntu OS; backend="threading" on Slurm.
      Parallel(n_jobs=args.num_workers)(
          delayed(__maybe_download_file)(
              data_url, dataset_root / Path(data_url).name
          )
          for _, data_url in data_source.items()
      )
  
      # unzip datasets
      # Note: you need to verify which backend works well on your cluster.
      # backend="loky" is fine on multi-core Ubuntu OS; backend="threading" on Slurm.
      Parallel(n_jobs=args.num_workers)(
          delayed(__extract_file)(
              dataset_root / Path(data_url).name, dataset_root
          )
          for _, data_url in data_source.items()
      )
  
      # generate json files for train/val/test splits
      stats_path_root = (
          dataset_root / Path(stats_source).stem / "speacker"
      )
      entries_train, entries_val, entries_test = [], [], []
      speaker_entries = []
      num_speakers = 0
      for child in stats_path_root.iterdir():
          if child.is_dir():
              speaker = child.name
              num_speakers += 1
              speaker_stats_root = stats_path_root / speaker
              speaker_data_path = dataset_root / speaker
  
              logging.info(f"Processing Speaker: {speaker}")
              results = __process_data(
                  speaker_data_path,
                  speaker_stats_root,
                  num_speakers,
                  args.min_duration,
                  args.max_duration,
                  args.val_num_utts_per_speaker,
                  args.test_num_utts_per_speaker,
                  args.seed_for_ds_split,
              )
  
              entries_train.extend(results["train"])
              entries_val.extend(results["val"])
              entries_test.extend(results["test"])
  
              speaker_entry = {
                  "speaker_name": speaker,
                  "speaker_id": num_speakers,
                  "hours": results["hours"],
                  "num_utts": results["num_utts"],
                  "is_skipped": results["is_skipped"],
              }
              speaker_entries.append(speaker_entry)
  
      # shuffle in place across multiple speakers
      random.Random(args.seed_for_ds_split).shuffle(entries_train)
      random.Random(args.seed_for_ds_split).shuffle(entries_val)
      random.Random(args.seed_for_ds_split).shuffle(entries_test)
  
      # save speaker stats.
      df = pd.DataFrame.from_records(speaker_entries)
      df.sort_values(by="hours", ascending=False, inplace=True)
      spk2id_file_path = manifests_root / "spk2id.csv"
      df.to_csv(spk2id_file_path, index=False)
      logging.info(
          f"Saving Speaker to ID mapping to {spk2id_file_path}."
      )
  
      # save json splits.
      train_json = manifests_root / "train_manifest.json"
      val_json = manifests_root / "val_manifest.json"
      test_json = manifests_root / "test_manifest.json"
      __save_json(train_json, entries_train)
      __save_json(val_json, entries_val)
      __save_json(test_json, entries_test)
  
      # normalize text if requested. New json file, train_manifest_text_normed.json, will be generated.
      if args.normalize_text:
          __text_normalization(train_json, args.num_workers)
          __text_normalization(val_json, args.num_workers)
          __text_normalization(test_json, args.num_workers)
  
file_path: NeMo/scripts/dataset_processing/tts/hui_acg/get_data.py
imports: import argparse
  import json
  import random
  import shutil
  import urllib.request
  from pathlib import Path
  import pandas
  from joblib import Parallel, delayed
  from tqdm import tqdm
  from nemo.utils import logging
label_desc: Use image node_id 7 for calling a global function with example usage: main() without return types