class_docstr: *Snips* :cite:`coucke2018snips` dataset.
  
  Args:
      root (str or Path): Root directory where the dataset's top level directory is found.
      subset (str): Subset of the dataset to use. Options: [``"train"``, ``"valid"``, ``"test"``].
      speakers (List[str] or None, optional): The speaker list to include in the dataset. If ``None``,
          include all speakers in the subset. (Default: ``None``)
      audio_format (str, optional): The extension of the audios. Options: [``"mp3"``, ``"wav"``].
          (Default: ``"mp3"``)
class_docstr_tok: ["*","Snips","*",":","cite",":","`","coucke2018snips","`","dataset",".","Args",":","root","(","str","or","Path",")",":","Root","directory","where","the","dataset","'s","top","level","directory","is","found",".","subset","(","str",")",":","Subset","of","the","dataset","to","use",".","Options",":","[","``","``","train","''","``",",","``","``","valid","''","``",",","``","``","test","''","``","]",".","speakers","(","List","[","str","]","or","None",",","optional",")",":","The","speaker","list","to","include","in","the","dataset",".","If","``","None","``",",","include","all","speakers","in","the","subset",".","(","Default",":","``","None","``",")","audio_format","(","str",",","optional",")",":","The","extension","of","the","audios",".","Options",":","[","``","``","mp3","''","``",",","``","``","wav","''","``","]",".","(","Default",":","``","``","mp3","''","``",")"]
code: def __init__(
      self,
      root: Union[str, Path],
      subset: str,
      speakers: Optional[List[str]] = None,
      audio_format: str = "mp3",
  ) -> None:
      if subset not in ["train", "valid", "test"]:
          raise ValueError(
              '`subset` must be one of ["train", "valid", "test"].'
          )
      if audio_format not in ["mp3", "wav"]:
          raise ValueError(
              '`audio_format` must be one of ["mp3", "wav].'
          )
  
      root = Path(root)
      self._path = root / "SNIPS"
      self.audio_path = self._path / subset
      if speakers is None:
          speakers = _SPEAKERS
  
      if not os.path.isdir(self._path):
          raise RuntimeError("Dataset not found.")
  
      self.audio_paths = self.audio_path.glob(f"*.{audio_format}")
      self.data = []
      for audio_path in sorted(self.audio_paths):
          audio_name = str(audio_path.name)
          speaker = audio_name.split("-")[0]
          if speaker in speakers:
              self.data.append(audio_path)
      transcript_path = self._path / self._trans_file
      self.labels = _load_labels(transcript_path, subset)
  
file_path: audio/src/torchaudio/datasets/snips.py
imports: import os
  from pathlib import Path
  from typing import List, Optional, Tuple, Union
  import torch
  from torch.utils.data import Dataset
  from torchaudio.datasets.utils import _load_waveform
label_desc: Use image node_id 1 to create a new Snips object from inherited base classes: Dataset with example: obj = Snips(root, subset, speakers, audio_format)