code: def get_mock_dataset(dataset_dir):
      """
      dataset_dir: directory to the mocked dataset
      """
      mocked_samples = []
      mocked_train_samples = []
      mocked_valid_samples = []
      mocked_test_samples = []
      os.makedirs(dataset_dir, exist_ok=True)
      sample_rate = 16000  # 16kHz sample rate
      seed = 0
      valid_file = os.path.join(dataset_dir, "validation_list.txt")
      test_file = os.path.join(dataset_dir, "testing_list.txt")
      with open(valid_file, "w") as valid, open(test_file, "w") as test:
          for label in _LABELS:
              path = os.path.join(dataset_dir, label)
              os.makedirs(path, exist_ok=True)
              for j in range(6):
                  # generate hash ID for speaker
                  speaker = "{:08x}".format(j)
  
                  for utterance in range(3):
                      filename = f"{speaker}{speechcommands.HASH_DIVIDER}{utterance}.wav"
                      file_path = os.path.join(path, filename)
                      seed += 1
                      data = get_whitenoise(
                          sample_rate=sample_rate,
                          duration=0.01,
                          n_channels=1,
                          dtype="int16",
                          seed=seed,
                      )
                      save_wav(file_path, data, sample_rate)
                      sample = (
                          normalize_wav(data),
                          sample_rate,
                          label,
                          speaker,
                          utterance,
                      )
                      mocked_samples.append(sample)
                      if j < 2:
                          mocked_train_samples.append(sample)
                      elif j < 4:
                          valid.write(f"{label}/{filename}\n")
                          mocked_valid_samples.append(sample)
                      elif j < 6:
                          test.write(f"{label}/{filename}\n")
                          mocked_test_samples.append(sample)
      return (
          mocked_samples,
          mocked_train_samples,
          mocked_valid_samples,
          mocked_test_samples,
      )
  
file_path: audio/test/torchaudio_unittest/datasets/speechcommands_test.py
imports: import os
  from pathlib import Path
  from torchaudio.datasets import speechcommands
  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(dataset_dir) and returns: mocked_samples,  mocked_train_samples,  mocked_valid_samples,  mocked_test_samples