code: def temp_ssv2_dataset():
      frame_names = [f"{str(i)}.png" for i in range(7)]
  
      # Create json file for label names.
      labels = [
          "Approaching something with your camera",
          "Attaching something to something",
      ]
      label_names = {labels[0]: "0", labels[1]: "1"}
      with tempfile.NamedTemporaryFile(
          mode="w", delete=False, suffix=".json"
      ) as f:
          json.dump(label_names, f)
          label_name_file = f.name
  
      # Create csv containing 2 test frame videos.
      with tempfile.NamedTemporaryFile(
          delete=False, suffix=".csv"
      ) as f:
          f.write(
              "original_vido_id video_id frame_id path labels\n".encode()
          )
  
          # Frame video 1
          with temp_frame_video(frame_names) as (
              frame_1_video_dir,
              data_1,
          ):
              for i, frame_name in enumerate(frame_names):
                  original_video_id = str(frame_1_video_dir)
                  video_id = "1"
                  frame_id = str(i)
                  path = pathlib.Path(frame_1_video_dir) / frame_name
                  f.write(
                      f"{original_video_id} {video_id} {frame_id} {path} ''\n".encode()
                  )
  
              # Frame video 2
              with temp_frame_video(frame_names) as (
                  frame_2_video_dir,
                  data_2,
              ):
                  for i, frame_name in enumerate(frame_names):
                      original_video_id = str(frame_2_video_dir)
                      video_id = "2"
                      frame_id = str(i)
                      path = (
                          pathlib.Path(frame_2_video_dir) / frame_name
                      )
                      f.write(
                          f"{original_video_id} {video_id} {frame_id} {path} ''\n".encode()
                      )
  
                  f.close()
                  video_path_file = f.name
  
                  # Create json file for lable names.
                  with tempfile.NamedTemporaryFile(
                      mode="w", delete=False, suffix=".json"
                  ) as f:
                      videos = [
                          {
                              "id": str(frame_1_video_dir),
                              "template": labels[0],
                          },
                          {
                              "id": str(frame_2_video_dir),
                              "template": labels[1],
                          },
                      ]
                      json.dump(videos, f)
                      video_label_file = f.name
  
                  yield label_name_file, video_label_file, video_path_file, data_1, data_2
  
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 a global function with example usage: temp_ssv2_dataset() without return types