class_docstr: Action recognition video dataset for
  `Something-something v2 (SSv2) <https://20bn.com/datasets/something-something>`_ stored
  as image frames.
  
  This dataset handles the parsing of frames, loading and clip sampling for the
  videos. All io is done through :code:`iopath.common.file_io.PathManager`, enabling
  non-local storage uri's to be used.
class_docstr_tok: ["Action","recognition","video","dataset","for","`","Something-something","v2","(","SSv2",")","<","https",":","\/\/20bn.com\/datasets\/something-something",">","`","_","stored","as","image","frames",".","This","dataset","handles","the","parsing","of","frames",",","loading","and","clip","sampling","for","the","videos",".","All","io","is","done","through",":","code",":","`","iopath.common.file_io.PathManager","`",",","enabling","non-local","storage","uri","'s","to","be","used","."]
docstr: Retrieves the next clip based on the clip sampling strategy and video sampler.
  
  Returns:
      A dictionary with the following format.
  
      .. code-block:: text
  
          {
              'video': <video_tensor>,
              'label': <index_label>,
              'video_label': <index_label>
              'video_index': <video_index>,
              'clip_index': <clip_index>,
              'aug_index': <aug_index>,
          }
docstr_tok: ["Retrieves","the","next","clip","based","on","the","clip","sampling","strategy","and","video","sampler",".","Returns",":","A","dictionary","with","the","following","format",".","..","code-block",":",":","text","{","'video","'",":","<","video_tensor",">",",","'label","'",":","<","index_label",">",",","'video_label","'",":","<","index_label",">","'video_index","'",":","<","video_index",">",",","'clip_index","'",":","<","clip_index",">",",","'aug_index","'",":","<","aug_index",">",",","}"]
code: def __next__(self) -> dict:
      """
      Retrieves the next clip based on the clip sampling strategy and video sampler.
  
      Returns:
          A dictionary with the following format.
  
          .. code-block:: text
  
              {
                  'video': <video_tensor>,
                  'label': <index_label>,
                  'video_label': <index_label>
                  'video_index': <video_index>,
                  'clip_index': <clip_index>,
                  'aug_index': <aug_index>,
              }
      """
      if not self._video_sampler_iter:
          # Setup MultiProcessSampler here - after PyTorch DataLoader workers are spawned.
          self._video_sampler_iter = iter(
              MultiProcessSampler(self._video_sampler)
          )
  
      if self._loaded_video:
          video, video_index = self._loaded_video
      else:
          video_index = next(self._video_sampler_iter)
          path_to_video_frames = self._path_to_videos[video_index]
          video = FrameVideo.from_frame_paths(path_to_video_frames)
          self._loaded_video = (video, video_index)
  
      (
          clip_start,
          clip_end,
          clip_index,
          aug_index,
          is_last_clip,
      ) = self._clip_sampler(
          self._next_clip_start_time, video.duration, {}
      )
      # Only load the clip once and reuse previously stored clip if there are multiple
      # views for augmentations to perform on the same clip.
      if aug_index == 0:
          self._loaded_clip = video.get_clip(
              0, video.duration, self._frame_filter
          )
  
      self._next_clip_start_time = clip_end
  
      if is_last_clip:
          self._loaded_video = None
          self._next_clip_start_time = 0.0
  
      sample_dict = {
          "video": self._loaded_clip["video"],
          "label": self._labels[video_index],
          "video_name": str(video_index),
          "video_index": video_index,
          "clip_index": clip_index,
          "aug_index": aug_index,
      }
      if self._transform is not None:
          sample_dict = self._transform(sample_dict)
  
      return sample_dict
  
imports: import csv
  import functools
  import json
  import os
  import random
  from collections import defaultdict
  from typing import Any, Callable, List, Optional, Tuple, Type
  import numpy
  import torch
  import torch.utils.data
  from iopath.common.file_io import g_pathmgr
  from pytorchvideo.data.clip_sampling import ClipSampler
  from pytorchvideo.data.frame_video import FrameVideo
  from .utils import MultiProcessSampler
label_desc: Use image node_id 4 for calling the SSv2 obj's underlying member method code with example usage: obj.__next__() and returns: sample_dict