code: def collect_data(
      data_dir: Union[Path, str], lang: str, split: str, prefix: str
  ) -> List[List[Utterance]]:
      """Collect utterances in each long talk."""
      data_dir = Path(data_dir)
      with open(data_dir / f"GigaST.converted.{lang}.json", "r") as fp:
          info = json.load(fp)
  
      ret = []
      for audio in info["audios"]:
          if ("{" + split + "}") in audio["subsets"]:
              wav_path = data_dir / audio["path"]
              assert wav_path.is_file()
  
              utts = []
              for seg in audio["segments"]:
                  text = preprocess_text(seg["text_tn"])
                  if text:
                      utts.append(
                          Utterance(
                              utt_id=f"{prefix}_{seg['sid']}",
                              wav_id=f"{prefix}_{audio['aid']}",
                              wav_path=(
                                  f"ffmpeg -i {str(wav_path.resolve())} -ac 1 -ar 16000"
                                  " -f wav - |"
                              ),
                              start_time=seg["begin_time"],
                              end_time=seg["end_time"],
                              lang="<en>",
                              task=f"<st_{lang}>",
                              text=text,
                              asr_text=seg["text_asr"],
                          )
                      )
              ret.append(utts)
      return ret
  
file_path: espnet/egs2/owsm_v2/s2t1/local/prepare_gigast.py
imports: import json
  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 2 for calling a global function with example usage: collect_data(data_dir, lang, split, prefix) and returns: ret