code: def get_mock_dataset(dataset_dir):
      """
      dataset_dir: directory of the mocked dataset
      """
      mocked_samples = {}
      os.makedirs(dataset_dir, exist_ok=True)
      sample_rate = 16000  # 16kHz
      seed = 0
  
      for release in ["release1", "release2", "release3"]:
          data = get_whitenoise(
              sample_rate=sample_rate,
              duration=10.00,
              n_channels=1,
              dtype="float32",
              seed=seed,
          )
          if release in ["release1", "release2"]:
              release_dir = os.path.join(
                  dataset_dir,
                  tedlium._RELEASE_CONFIGS[release][
                      "folder_in_archive"
                  ],
                  tedlium._RELEASE_CONFIGS[release]["subset"],
              )
          else:
              release_dir = os.path.join(
                  dataset_dir,
                  tedlium._RELEASE_CONFIGS[release][
                      "folder_in_archive"
                  ],
                  tedlium._RELEASE_CONFIGS[release]["data_path"],
              )
          os.makedirs(release_dir, exist_ok=True)
          os.makedirs(
              os.path.join(release_dir, "stm"), exist_ok=True
          )  # Subfolder for transcripts
          os.makedirs(
              os.path.join(release_dir, "sph"), exist_ok=True
          )  # Subfolder for audio files
          filename = f"{release}.sph"
          path = os.path.join(
              os.path.join(release_dir, "sph"), filename
          )
          save_wav(path, data, sample_rate)
  
          trans_filename = f"{release}.stm"
          trans_path = os.path.join(
              os.path.join(release_dir, "stm"), trans_filename
          )
          with open(trans_path, "w") as f:
              f.write("".join(_UTTERANCES))
  
          dict_filename = f"{release}.dic"
          dict_path = os.path.join(release_dir, dict_filename)
          with open(dict_path, "w") as f:
              f.write("\n".join(_PHONEME))
  
          # Create a samples list to compare with
          mocked_samples[release] = []
          for utterance in _UTTERANCES:
              (
                  talk_id,
                  _,
                  speaker_id,
                  start_time,
                  end_time,
                  identifier,
                  transcript,
              ) = utterance.split(" ", 6)
              start_time = int(float(start_time)) * sample_rate
              end_time = int(float(end_time)) * sample_rate
              sample = (
                  data[:, start_time:end_time],
                  sample_rate,
                  transcript,
                  talk_id,
                  speaker_id,
                  identifier,
              )
              mocked_samples[release].append(sample)
          seed += 1
      return mocked_samples
  
file_path: audio/test/torchaudio_unittest/datasets/tedlium_test.py
imports: import os
  from pathlib import Path
  from torchaudio.datasets import tedlium
  from torchaudio_unittest.common_utils import get_whitenoise, save_wav, TempDirMixin, TorchaudioTestCase
label_desc: Use image node_id 1 for calling a global function with example usage: get_mock_dataset(dataset_dir) and returns: mocked_samples