code: def get_mock_dataset(
      root_dir, train_csv_contents, ext_audio
  ) -> Tuple[Tensor, int, Dict[str, str]]:
      """
      prepares mocked dataset
      """
      mocked_data = []
      # Note: extension is changed to wav for the sake of test
      # Note: the first content is missing values for `age`, `gender` and `accent` as in the original data.
      # Tsv file name difference does not mean different subset, testing as a whole dataset here
      tsv_filename = os.path.join(root_dir, "train.tsv")
      audio_base_path = os.path.join(root_dir, "clips")
      os.makedirs(audio_base_path, exist_ok=True)
      with open(tsv_filename, "w", newline="") as tsv:
          writer = csv.writer(tsv, delimiter="\t")
          writer.writerow(_HEADERS)
          for i, content in enumerate(train_csv_contents):
              content[2] = str(content[2].encode("utf-8"))
              writer.writerow(content)
              if not content[1].endswith(ext_audio):
                  audio_path = os.path.join(
                      audio_base_path, content[1] + ext_audio
                  )
              else:
                  audio_path = os.path.join(audio_base_path, content[1])
  
              data = get_whitenoise(
                  sample_rate=_SAMPLE_RATE,
                  duration=1,
                  n_channels=1,
                  seed=i,
                  dtype="float32",
              )
              save_wav(audio_path, data, _SAMPLE_RATE)
              # Append data entry
              mocked_data.append(
                  (
                      normalize_wav(data),
                      _SAMPLE_RATE,
                      dict(zip(_HEADERS, content)),
                  )
              )
      return mocked_data
  
imports: import csv
  import os
  from pathlib import Path
  from typing import Dict, Tuple
  from torch import Tensor
  from torchaudio.datasets import COMMONVOICE
  from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin, TorchaudioTestCase
label_desc: Use image node_id 1 for calling a global function with example usage: get_mock_dataset(root_dir, train_csv_contents, ext_audio) and returns: mocked_data