class_docstr: Google's Speech Commands dataset for keyword spotting (https://arxiv.org/abs/1804.03209).
  
  This contains the "v2" version for 12-way classification (10 commands,
  plus unknown and background categories).
  
  Args:
      opts: Command-line arguments
docstr: Get the sample at the index specified by @index.
  
  Args:
      index: The index of the sample.
  
  Returns:
      A sample as a dictionary. It contains:
          {
              "samples":
                  {
                      "audio": A [C, N] tensor, where C is the number of
                          channels, and N is the length.
                  }
              "targets": an integer class label.
              "sample_id": an integer giving the sample index.
              "metadata":
                  {
                      "audio_fps": The sampling rate of the audio.
                  }
          }
docstr_tok: ["Get","the","sample","at","the","index","specified","by","@","index",".","Args",":","index",":","The","index","of","the","sample",".","Returns",":","A","sample","as","a","dictionary",".","It","contains",":","{","``","samples","''",":","{","``","audio","''",":","A","[","C",",","N","]","tensor",",","where","C","is","the","number","of","channels",",","and","N","is","the","length.","}","``","targets","''",":","an","integer","class","label",".","``","sample_id","''",":","an","integer","giving","the","sample","index",".","``","metadata","''",":","{","``","audio_fps","''",":","The","sampling","rate","of","the","audio.","}","}"]
code: def get_transformed_sample(
      self, index: int
  ) -> Dict[str, Union[Dict[str, Tensor], Tensor, int]]:
      """
      Get the sample at the index specified by @index.
  
      Args:
          index: The index of the sample.
  
      Returns:
          A sample as a dictionary. It contains:
              {
                  "samples":
                      {
                          "audio": A [C, N] tensor, where C is the number of
                              channels, and N is the length.
                      }
                  "targets": an integer class label.
                  "sample_id": an integer giving the sample index.
                  "metadata":
                      {
                          "audio_fps": The sampling rate of the audio.
                      }
              }
      """
      waveform, audio_fps, label = self.get_sample(index)
  
      data = {
          "samples": {"audio": waveform},
          "targets": label,
          "sample_id": index,
          "metadata": {"audio_fps": audio_fps},
      }
  
      transform_fn = self.get_augmentation_transforms()
      data = transform_fn(data)
  
      return data
  
imports: import argparse
  import json
  import os
  import random
  from typing import Dict, Tuple, Union
  import torch
  import torchaudio
  from torch import Tensor
  from torch.nn import functional
  from data.datasets import DATASET_REGISTRY, dataset_base
  from data.transforms.audio import Noise, Roll, SetFixedLength
  from data.transforms.common import Compose
  from data.transforms.image_pil import BaseTransformation
label_desc: Use image node_id 8 for calling the SpeechCommandsv2Dataset obj's underlying member method code with example usage: obj.get_transformed_sample(index) and returns: data