code: def _get_samples(dataset_dir: str, session: int):
      session_folder = os.path.join(dataset_dir, f"Session{session}")
      os.makedirs(session_folder, exist_ok=True)
  
      wav_folder = os.path.join(session_folder, "sentences", "wav")
      label_folder = os.path.join(
          session_folder, "dialog", "EmoEvaluation"
      )
      os.makedirs(wav_folder, exist_ok=True)
      os.makedirs(label_folder, exist_ok=True)
  
      wav_stems = []
      for i in range(5):
          for g in ["F", "M"]:
              for utt in ["impro", "script"]:
                  speaker = f"Ses0{session}{g}"
                  subfolder = f"{speaker}_{utt}0{i}"
                  subfolder_path = os.path.join(wav_folder, subfolder)
                  os.makedirs(subfolder_path, exist_ok=True)
  
                  for j in range(5):
                      wav_stem = f"{subfolder}_F00{j}"
                      wav_stems.append(wav_stem)
  
      all_samples = []
      impro_samples = []
      script_samples = []
      wav_stems = sorted(wav_stems)
      for wav_stem in wav_stems:
          subfolder = wav_stem[:-5]
          speaker = subfolder.split("_")[0]
  
          wav_file = os.path.join(
              wav_folder, subfolder, wav_stem + ".wav"
          )
          wav = _save_wav(wav_file, seed=0)
          label = _save_label(
              label_folder, subfolder + ".txt", wav_stem
          )
          if label == "xxx":
              continue
          sample = (wav, SAMPLE_RATE, wav_stem, label, speaker)
          all_samples.append(sample)
  
          if "impro" in subfolder:
              impro_samples.append(sample)
          else:
              script_samples.append(sample)
  
      return all_samples, script_samples, impro_samples
  
file_path: audio/test/torchaudio_unittest/datasets/iemocap_test.py
imports: import os
  import random
  from torchaudio.datasets import iemocap
  from torchaudio_unittest.common_utils import get_whitenoise, save_wav, TempDirMixin, TorchaudioTestCase
label_desc: Use image node_id 3 for calling a global function with example usage: _get_samples(dataset_dir, session) and returns: all_samples,  script_samples,  impro_samples