code: def create_files(speakers, directory):
      text_lines, scp_lines, utt2spk_lines = [], [], []
      for spk_id in speakers:
          for utt_id in d[spk_id]:
              # add spk_id in front to make utt_id unique
              unique_utt_id = spk_id + utt_id
  
              transcription = get_transcription(spk_id, utt_id)
              text_lines.append(f"{unique_utt_id} {transcription}\n")
  
              wav_file_path = get_wav_filename(spk_id, utt_id)
              scp_lines.append(f"{unique_utt_id} {wav_file_path}\n")
  
              utt2spk_lines.append(f"{unique_utt_id} {spk_id}\n")
  
      # sort
      text_lines.sort()
      scp_lines.sort()
      utt2spk_lines.sort()
  
      # write to file
      with open(f"{directory}/text", "w+") as text_file:
          text_file.writelines(text_lines)
  
      with open(f"{directory}/wav.scp", "w+") as scp_file:
          scp_file.writelines(scp_lines)
  
      with open(f"{directory}/utt2spk", "w+") as utt2spk_file:
          utt2spk_file.writelines(utt2spk_lines)
  
imports: import os
  import random
  import sys
  from collections import defaultdict
label_desc: Use image node_id 4 for calling a global function with example usage: create_files(speakers, directory) without return types