class_docstr: Egocentric classification video clip-based dataset for
  `DoMSEV <https://www.verlab.dcc.ufmg.br/semantic-hyperlapse/cvpr2018-dataset/>`_
  stored as an encoded video (with frame-level labels).
  
  This dataset handles the loading, decoding, and configurable clip
  sampling for the videos.
class_docstr_tok: ["Egocentric","classification","video","clip-based","dataset","for","`","DoMSEV","<","https",":","\/\/www.verlab.dcc.ufmg.br\/semantic-hyperlapse\/cvpr2018-dataset\/",">","`","_","stored","as","an","encoded","video","(","with","frame-level","labels",")",".","This","dataset","handles","the","loading",",","decoding",",","and","configurable","clip","sampling","for","the","videos","."]
docstr: Samples a video clip associated to the given index.
  
  Args:
      index (int): index for the video clip.
  
  Returns:
      A video clip with the following format if transform is None.
  
      .. code-block:: text
  
          {{
              'video_id': <str>,
              'video': <video_tensor>,
              'audio': <audio_tensor>,
              'labels': <labels_tensor>,
              'start_time': <float>,
              'stop_time': <float>
          }}
docstr_tok: ["Samples","a","video","clip","associated","to","the","given","index",".","Args",":","index","(","int",")",":","index","for","the","video","clip",".","Returns",":","A","video","clip","with","the","following","format","if","transform","is","None",".","..","code-block",":",":","text","{","{","'video_id","'",":","<","str",">",",","'video","'",":","<","video_tensor",">",",","'audio","'",":","<","audio_tensor",">",",","'labels","'",":","<","labels_tensor",">",",","'start_time","'",":","<","float",">",",","'stop_time","'",":","<","float",">","}","}"]
code: def __getitem__(self, index) -> Dict[str, Any]:
      """
      Samples a video clip associated to the given index.
  
      Args:
          index (int): index for the video clip.
  
      Returns:
          A video clip with the following format if transform is None.
  
          .. code-block:: text
  
              {{
                  'video_id': <str>,
                  'video': <video_tensor>,
                  'audio': <audio_tensor>,
                  'labels': <labels_tensor>,
                  'start_time': <float>,
                  'stop_time': <float>
              }}
      """
      clip = self._clips[index]
  
      # Filter labels by only the ones that appear within the clip boundaries,
      # and unpack the labels so there is one per frame in the clip
      labels_in_video = self._labels_per_video[clip.video_id]
      labels_in_clip = []
      for label_data in labels_in_video:
          overlap_period = _get_overlap_for_time_range_pair(
              clip.start_time,
              clip.stop_time,
              label_data.start_time,
              label_data.stop_time,
          )
          if overlap_period is not None:
              overlap_start_time, overlap_stop_time = overlap_period
  
              # Convert the overlapping period between clip and label to
              # 0-indexed start and stop frame indexes, so we can unpack 1
              # label per frame.
              overlap_start_frame = _seconds_to_frame_index(
                  overlap_start_time, self._frames_per_second
              )
              overlap_stop_frame = _seconds_to_frame_index(
                  overlap_stop_time, self._frames_per_second
              )
  
              # Append 1 label per frame
              for _ in range(overlap_start_frame, overlap_stop_frame):
                  labels_in_clip.append(label_data)
  
      # Convert the list of LabelData objects to a tensor of just the label IDs
      label_ids = [
          labels_in_clip[i].label_id for i in range(len(labels_in_clip))
      ]
      label_ids_tensor = torch.tensor(label_ids)
  
      clip_data = {
          "video_id": clip.video_id,
          **self._videos[clip.video_id].get_clip(
              clip.start_time, clip.stop_time
          ),
          "labels": label_ids_tensor,
          "start_time": clip.start_time,
          "stop_time": clip.stop_time,
      }
  
      if self._transform:
          clip_data = self._transform(clip_data)
  
      return clip_data
  
imports: import logging
  import math
  import random
  import time
  from dataclasses import dataclass
  from enum import Enum
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import numpy
  import torch
  from iopath.common.file_io import g_pathmgr
  from PIL import Image
  from pytorchvideo.data.dataset_manifest_utils import ImageDataset, ImageFrameInfo, VideoClipInfo, VideoDataset, VideoDatasetType
  from pytorchvideo.data.utils import DataclassFieldCaster, load_dataclass_dict_from_csv
  from pytorchvideo.data.video import Video
label_desc: Use image node_id 2 for calling the DomsevVideoDataset obj's underlying member method code with example usage: obj.__getitem__(index) and returns: clip_data