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 __init__(
      self, video_clips: VideoClips, max_clips_per_video: int
  ) -> None:
      if not isinstance(video_clips, VideoClips):
          raise TypeError(
              f"Expected video_clips to be an instance of VideoClips, got {type(video_clips)}"
          )
      self.video_clips = video_clips
      self.max_clips_per_video = max_clips_per_video
  
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 1 to create a new RandomClipSampler object from inherited base classes: Sampler with example: obj = RandomClipSampler(video_clips, max_clips_per_video)