code: def main():
      parser = argparse.ArgumentParser(
          description="Google Speech Commands Data download and preprocessing"
      )
      parser.add_argument(
          "--data_root",
          required=True,
          help="Root directory for storing data",
      )
      parser.add_argument(
          "--data_version",
          required=True,
          default=1,
          type=int,
          choices=[1, 2],
          help="Version of the speech commands dataset to download",
      )
      parser.add_argument(
          "--class_split",
          default="all",
          choices=["all", "sub"],
          help="Whether to consider all classes or only a subset",
      )
      parser.add_argument(
          "--num_processes",
          default=1,
          type=int,
          help="Number of processes",
      )
      parser.add_argument(
          "--rebalance",
          action="store_true",
          help="Rebalance the number of samples in each class",
      )
      parser.add_argument(
          "--skip_duration",
          action="store_true",
          help="Skip computing duration of audio files",
      )
      parser.add_argument(
          "--log", action="store_true", help="Generate logs"
      )
      args = parser.parse_args()
  
      if args.log:
          logging.basicConfig(level=logging.DEBUG)
  
      data_root = args.data_root
      data_set = f"google_speech_recognition_v{args.data_version}"
      data_folder = os.path.join(data_root, data_set)
  
      logging.info(f"Working on: {data_set}")
  
      URL = URL_v1 if args.data_version == 1 else URL_v2
  
      # Download and extract
      if not os.path.exists(data_folder):
          file_path = os.path.join(data_root, data_set + ".tar.bz2")
          logging.info(f"Getting {data_set}")
          __maybe_download_file(file_path, URL)
          logging.info(f"Extracting {data_set}")
          __extract_all_files(file_path, data_folder)
  
      logging.info(f"Processing {data_set}")
      __process_data(
          data_folder,
          data_folder,
          num_processes=args.num_processes,
          rebalance=args.rebalance,
          class_split=args.class_split,
          skip_duration=args.skip_duration,
      )
      logging.info("Done!")
  
imports: import argparse
  import glob
  import json
  import logging
  import os
  import re
  import tarfile
  import urllib.request
  from collections import defaultdict
  from functools import partial
  from multiprocessing import Pool
  from typing import Dict, List, Set, Tuple
  import librosa
  import numpy
  import soundfile
  from tqdm import tqdm
label_desc: Use image node_id 10 for calling a global function with example usage: main() without return types