class_docstr: Create a Dataset for MuST-C. Each item is a tuple of the form:
  waveform, sample_rate, source utterance, target utterance, speaker_id,
  utterance_id
class_docstr_tok: ["Create","a","Dataset","for","MuST-C.","Each","item","is","a","tuple","of","the","form",":","waveform",",","sample_rate",",","source","utterance",",","target","utterance",",","speaker_id",",","utterance_id"]
code: def __init__(self, root: str, lang: str, split: str) -> None:
      assert split in self.SPLITS and lang in self.LANGUAGES
      _root = Path(root) / f"en-{lang}" / "data" / split
      wav_root, txt_root = _root / "wav", _root / "txt"
      assert _root.is_dir() and wav_root.is_dir() and txt_root.is_dir()
      # Load audio segments
      try:
          import yaml
      except ImportError:
          print("Please install PyYAML to load the MuST-C YAML files")
      with open(txt_root / f"{split}.yaml") as f:
          segments = yaml.load(f, Loader=yaml.BaseLoader)
      # Load source and target utterances
      for _lang in ["en", lang]:
          with open(txt_root / f"{split}.{_lang}") as f:
              utterances = [r.strip() for r in f]
          assert len(segments) == len(utterances)
          for i, u in enumerate(utterances):
              segments[i][_lang] = u
      # Gather info
      self.data = []
      for wav_filename, _seg_group in groupby(
          segments, lambda x: x["wav"]
      ):
          wav_path = wav_root / wav_filename
          sample_rate = sf.info(wav_path.as_posix()).samplerate
          seg_group = sorted(_seg_group, key=lambda x: x["offset"])
          for i, segment in enumerate(seg_group):
              offset = int(float(segment["offset"]) * sample_rate)
              n_frames = int(float(segment["duration"]) * sample_rate)
              _id = f"{wav_path.stem}_{i}"
              self.data.append(
                  (
                      wav_path.as_posix(),
                      offset,
                      n_frames,
                      sample_rate,
                      segment["en"],
                      segment[lang],
                      segment["speaker_id"],
                      _id,
                  )
              )
  
imports: import argparse
  import logging
  import os
  from pathlib import Path
  import shutil
  from itertools import groupby
  from tempfile import NamedTemporaryFile
  from typing import Tuple
  import numpy
  import pandas
  import soundfile
  from examples.speech_to_text.data_utils import create_zip, extract_fbank_features, filter_manifest_df, gen_config_yaml, gen_vocab, get_zip_manifest, load_df_from_tsv, save_df_to_tsv, cal_gcmvn_stats
  import torch
  from torch.utils.data import Dataset
  from tqdm import tqdm
  from fairseq.data.audio.audio_utils import get_waveform, convert_waveform
label_desc: Use image node_id 1 to create a new MUSTC object from inherited base classes: Dataset with example: obj = MUSTC(root, lang, split)