code: def test_single_clip_per_video_works(self):
      with temp_ssv2_dataset() as (
          label_name_file,
          video_label_file,
          video_path_file,
          video_1,
          video_2,
      ):
          # Put arbitrary duration as ssv2 always needs full video clip.
          clip_sampler = make_clip_sampler(
              "constant_clips_per_video", 1.0, 1
          )
          # Expect taking 2 frames (1-th and 4-th among 7 frames).
          dataset = SSv2(
              label_name_file,
              video_label_file,
              video_path_file,
              clip_sampler=clip_sampler,
              video_sampler=SequentialSampler,
              frames_per_clip=2,
          )
          expected = [(0, video_1), (1, video_2)]
          for sample, expected_sample in zip(dataset, expected):
              self.assertEqual(sample["label"], expected_sample[0])
              self.assertTrue(
                  sample["video"].equal(expected_sample[1][:, (1, 4)])
              )
  
file_path: pytorchvideo/tests/test_data_ssv2_dataset.py
imports: import contextlib
  import json
  import pathlib
  import tempfile
  import unittest
  from pytorchvideo.data import SSv2
  from pytorchvideo.data.clip_sampling import make_clip_sampler
  from torch.utils.data import SequentialSampler
  from utils import temp_frame_video
label_desc: Use image node_id 1 for calling the TestSSv2Dataset obj's underlying member method code with example usage: obj.test_single_clip_per_video_works() without return types