code: def test_frame_filter_generator(self):
      # 11 seconds of video at 4 fps
      input_list = list(range(44))
  
      # 11 second clip at 4 fps, all frames are included
      frame_filter_fn = EpicKitchenForecasting._frame_filter_generator(
          seconds_per_clip=1,
          num_input_clips=11,
          frames_per_clip=4,
          clip_time_stride=1,
      )
  
      all_elements = frame_filter_fn(input_list)
  
      self.assertEqual(all_elements, input_list)
  
      # 11 second clip at 4 fps, seconds 0-1 and 10-11 are included
      frame_filter_fn = EpicKitchenForecasting._frame_filter_generator(
          seconds_per_clip=1,
          num_input_clips=2,
          frames_per_clip=4,
          clip_time_stride=10,
      )
      elements_2_clips = frame_filter_fn(input_list)
      self.assertEqual(len(elements_2_clips), 8)
      self.assertEqual(
          elements_2_clips, input_list[:4] + input_list[-4:]
      )
  
      # 11 second clip at 2 fps, seconds 0-1 and 10-11 are included
      frame_filter_fn = EpicKitchenForecasting._frame_filter_generator(
          seconds_per_clip=1,
          num_input_clips=2,
          frames_per_clip=2,
          clip_time_stride=10,
      )
      elements_2_clips_2fps = frame_filter_fn(input_list)
      self.assertEqual(len(elements_2_clips_2fps), 4)
      self.assertEqual(elements_2_clips_2fps, [0, 2, 40, 42])
  
file_path: pytorchvideo/tests/test_data_epic_kitchen_forecasting.py
imports: import unittest
  import unittest.mock
  import torch
  from pytorchvideo.data import EpicKitchenForecasting
  from pytorchvideo.data.epic_kitchen import ActionData
  from pytorchvideo.data.epic_kitchen_forecasting import ClipSampling
  from pytorchvideo.data.frame_video import FrameVideo
label_desc: Use image node_id 2 for calling the TestEpicKitchenForecasting obj's underlying member method code with example usage: obj.test_frame_filter_generator() without return types