code: def test_define_clip_structure_generator(self):
      seconds_per_clip = 5
      define_clip_structure_fn = (
          EpicKitchenRecognition._define_clip_structure_generator(
              seconds_per_clip=5,
              clip_sampling=ClipSampling.RandomOffsetUniform,
          )
      )
      frame_videos = {
          "P01_003": FrameVideo.from_frame_paths(
              [f"root/P01_003/frame_{i}" for i in range(100)], 10
          ),
          "P02_004": FrameVideo.from_frame_paths(
              [f"root/P02_004/frame_{i}" for i in range(300)], 10
          ),
          "P11_010": FrameVideo.from_frame_paths(
              [f"root/P11_010/frame_{i}" for i in range(600)], 30
          ),
      }
      actions = {video_id: [] for video_id in frame_videos}
      random_value = 0.5
      with unittest.mock.patch(
          "random.random", return_value=random_value
      ) as _:
          clips = define_clip_structure_fn(frame_videos, actions)
          sorted_clips = sorted(
              clips, key=lambda c: c.start_time
          )  # For stability
  
          for clip in sorted_clips:
              self.assertEqual(
                  clip.stop_time - clip.start_time, seconds_per_clip
              )
  
          clips_P01_003 = [
              c for c in sorted_clips if c.video_id == "P01_003"
          ]
          self.assertEqual(len(clips_P01_003), 1)
          for i in range(len(clips_P01_003)):
              self.assertEqual(
                  clips_P01_003[i].start_time,
                  seconds_per_clip * (i + random_value),
              )
  
          clips_P02_004 = [
              c for c in sorted_clips if c.video_id == "P02_004"
          ]
          self.assertEqual(len(clips_P02_004), 5)
          for i in range(len(clips_P02_004)):
              self.assertEqual(
                  clips_P02_004[i].start_time,
                  seconds_per_clip * (i + random_value),
              )
  
          clips_P11_010 = [
              c for c in sorted_clips if c.video_id == "P11_010"
          ]
          self.assertEqual(len(clips_P11_010), 3)
          for i in range(len(clips_P11_010)):
              self.assertEqual(
                  clips_P11_010[i].start_time,
                  seconds_per_clip * (i + random_value),
              )
  
file_path: pytorchvideo/tests/test_data_epic_kitchen_recognition.py
imports: import unittest
  import unittest.mock
  import torch
  from pytorchvideo.data import EpicKitchenRecognition
  from pytorchvideo.data.epic_kitchen import ActionData
  from pytorchvideo.data.epic_kitchen_recognition import ClipSampling
  from pytorchvideo.data.frame_video import FrameVideo
label_desc: Use image node_id 3 for calling the TestEpicKitchenRecognition obj's underlying member method code with example usage: obj.test_define_clip_structure_generator() without return types