code: def _gen_csv(dataset_dir: str, subset: str, init_seed: int):
      data = []
      data.append(HEADER)
  
      idx = 0
      seed = init_seed
      for _ in range(NUM_SPEAKERS):
          speaker_id = _gen_rand_str(5, seed=seed)
          speaker_dir = os.path.join(
              dataset_dir, "wavs", "speakers", speaker_id
          )
          os.makedirs(speaker_dir, exist_ok=True)
  
          for _ in range(SAMPLES_PER_SPEAKER):
              seed += 1
              filename = _gen_rand_str(10, seed=seed)
              path = f"wavs/speakers/{speaker_id}/{filename}.wav"
  
              random.seed(seed)
              transcription = ""
              act = random.choice(ACTIONS)
              obj = random.choice(OBJECTS)
              loc = random.choice(LOCATIONS)
  
              data.append(
                  [idx, path, speaker_id, transcription, act, obj, loc]
              )
  
              idx += 1
  
      csv_path = os.path.join(dataset_dir, "data", f"{subset}_data.csv")
      with open(csv_path, "w", newline="") as csv_file:
          file_writer = csv.writer(csv_file)
          file_writer.writerows(data)
  
      return data
  
file_path: audio/test/torchaudio_unittest/datasets/fluentcommands_test.py
imports: import csv
  import os
  import random
  import string
  from torchaudio.datasets import fluentcommands
  from torchaudio_unittest.common_utils import get_whitenoise, save_wav, TempDirMixin, TorchaudioTestCase
label_desc: Use image node_id 2 for calling a global function with example usage: _gen_csv(dataset_dir, subset, init_seed) and returns: data