code: def collect_data(
      data_dir: Union[Path, str], split: str, prefix: str
  ) -> List[List[Utterance]]:
      """Collect utterances in each long talk."""
      data_dir = Path(data_dir)
      speakers = [
          d.name for d in (data_dir / split).iterdir() if d.is_dir()
      ]
  
      ret = []
      for speaker in speakers:
          for chapter in (data_dir / "mp3" / speaker).iterdir():
              if chapter.is_dir():
                  utts = []
                  audio = str(
                      (chapter / f"{chapter.name}.mp3").resolve()
                  )
                  with open(
                      chapter
                      / f"{speaker}-{chapter.name}.sents.seg.txt",
                      "r",
                  ) as seg_f, open(
                      chapter
                      / f"{speaker}-{chapter.name}.sents.trans.txt",
                      "r",
                  ) as trans_f:
                      seg_lines = [
                          line.strip() for line in seg_f.readlines()
                      ]
                      trans_lines = [
                          line.strip() for line in trans_f.readlines()
                      ]
                      assert len(seg_lines) == len(trans_lines)
                      for seg, trans in zip(seg_lines, trans_lines):
                          utt_id, start_time, end_time = seg.split()
                          assert utt_id == trans.split(maxsplit=1)[0]
                          text = trans.split(maxsplit=1)[1].lower()
                          utts.append(
                              Utterance(
                                  utt_id=f"{prefix}_{utt_id}",
                                  wav_id=f"{prefix}_{speaker}_{chapter.name}",
                                  wav_path=f"sox {audio} -t wav -c 1 -r 16000 - |",
                                  start_time=float(start_time),
                                  end_time=float(end_time),
                                  lang="<en>",
                                  task="<asr>",
                                  text=text,
                                  asr_text=text,
                              )
                          )
                  ret.append(utts)
      return ret
  
imports: from argparse import ArgumentParser
  from collections import defaultdict
  from pathlib import Path
  from typing import Dict, List, Optional, Tuple, Union
  from utils import SYMBOL_NA, SYMBOL_NOSPEECH, SYMBOLS_TIME, LongUtterance, Utterance, generate_long_utterances
label_desc: Use image node_id 1 for calling a global function with example usage: collect_data(data_dir, split, prefix) and returns: ret