class_docstr: Samples at most `max_video_clips_per_video` clips for each video randomly
  
  Args:
      video_clips (VideoClips): video clips to sample from
      max_clips_per_video (int): maximum number of clips to be sampled per video
code: def __iter__(self) -> Iterator[int]:
      idxs = []
      s = 0
      # select at most max_clips_per_video for each video, randomly
      for c in self.video_clips.clips:
          length = len(c)
          size = min(length, self.max_clips_per_video)
          sampled = torch.randperm(length)[:size] + s
          s += length
          idxs.append(sampled)
      idxs_ = torch.cat(idxs)
      # shuffle all clips randomly
      perm = torch.randperm(len(idxs_))
      return iter(idxs_[perm].tolist())
  
imports: import math
  from typing import cast, Iterator, List, Optional, Sized, Union
  import torch
  import torch.distributed
  from torch.utils.data import Sampler
  from torchvision.datasets.video_utils import VideoClips
label_desc: Use image node_id 2 for calling the RandomClipSampler obj's underlying member method code with example usage: obj.__iter__() and returns: iter