code: def test_transform_generator(self):
      clip = {
          "start_time": 2.5,
          "stop_time": 6.5,
          "video": torch.rand(3, 8, 10, 20),
          "actions": [
              ActionData(
                  "P01",
                  "P01_01",
                  "turn off light",
                  "00:00:01.00",
                  "00:00:02.00",
                  262,
                  370,
                  "turn-off",
                  12,
                  "light",
                  113,
                  "['light']",
                  "[113]",
              ),
              ActionData(
                  "P01",
                  "P01_01",
                  "turn on light",
                  "00:00:04.00",
                  "00:00:06.00",
                  262,
                  370,
                  "turn-on",
                  12,
                  "light",
                  113,
                  "['light']",
                  "[113]",
              ),
              ActionData(
                  "P01",
                  "P01_01",
                  "close door",
                  "00:00:06.00",
                  "00:00:07.00",
                  418,
                  569,
                  "close",
                  3,
                  "door",
                  8,
                  "['door']",
                  "[8]",
              ),
              ActionData(
                  "P01",
                  "P01_01",
                  "slam door",
                  "00:00:10.00",
                  "00:00:11.00",
                  408,
                  509,
                  "slam",
                  3,
                  "door",
                  8,
                  "['door']",
                  "[8]",
              ),
              ActionData(
                  "P01",
                  "P01_01",
                  "slam door",
                  "00:00:11.00",
                  "00:00:12.00",
                  408,
                  509,
                  "slam",
                  3,
                  "door",
                  8,
                  "['door']",
                  "[8]",
              ),
              ActionData(
                  "P01",
                  "P01_01",
                  "slam door",
                  "00:00:12.00",
                  "00:00:13.00",
                  408,
                  509,
                  "slam",
                  3,
                  "door",
                  8,
                  "['door']",
                  "[8]",
              ),
          ],
      }
  
      def additional_transform(clip):
          clip["video"] = clip["video"].permute(1, 2, 3, 4, 0)
          return clip
  
      transform_fn = EpicKitchenForecasting._transform_generator(
          additional_transform,
          num_forecast_actions=3,
          num_input_clips=2,
          frames_per_clip=4,
      )
  
      transformed_clip = transform_fn(clip)
  
      self.assertEqual(len(transformed_clip["actions"]), 3)
  
      self.assertEqual(
          transformed_clip["actions"][0].narration, "slam door"
      )
      self.assertEqual(
          transformed_clip["actions"][1].narration, "slam door"
      )
      self.assertEqual(
          transformed_clip["actions"][2].narration, "slam door"
      )
  
      self.assertEqual(transformed_clip["actions"][0].start_time, 10.0)
      self.assertEqual(transformed_clip["actions"][1].start_time, 11.0)
      self.assertEqual(transformed_clip["actions"][2].start_time, 12.0)
  
      self.assertEqual(transformed_clip["start_time"], 2.5)
      self.assertEqual(transformed_clip["stop_time"], 6.5)
  
      self.assertEqual(
          transformed_clip["video"].size(),
          torch.Size([3, 4, 10, 20, 2]),
      )
  
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 1 for calling the TestEpicKitchenForecasting obj's underlying member method code with example usage: obj.test_transform_generator() and returns: clip