code: def test_video_reader_clips(
      reader_class,
      num_frames_per_clip,
      clips_per_video,
      is_training,
      output_video_fps,
      output_audio_fps,
      num_samples_per_clip,
      frame_stack_format,
  ):
      if reader_class is DecordAVReader and "decord" not in sys.modules:
          pytest.skip("Decord (optional dependncy) is not installed.")
      # This test makes sure that the dimension of the outputs match the expectations
      if frame_stack_format == "channel_first":
          channel_idx = 1
          time_idx = 2
      else:
          channel_idx = 2
          time_idx = 1
      opts = get_config()
      setattr(
          opts, "dataset.collate_fn_name_train", "default_collate_fn"
      )
      setattr(opts, "dataset.collate_fn_name_val", "default_collate_fn")
      setattr(
          opts, "video_reader.frame_stack_format", frame_stack_format
      )
      testfile = "tests/data/dummy_video.mov"
      silent_testfile = "tests/data/dummy_silent_video.mov"
      reader = reader_class(opts, is_training=is_training)
      silent_reader = reader_class(opts, is_training=is_training)
      video_channels = 3
      video, audio, metadata = reader.read_video_file_into_clips(
          testfile,
          num_frames_per_clip=num_frames_per_clip,
          clips_per_video=clips_per_video,
          is_training=is_training,
          output_video_fps=output_video_fps,
          output_audio_fps=output_audio_fps,
          num_samples_per_clip=num_samples_per_clip,
      ).values()
      (
          silent_video,
          silent_audio,
          silent_metadata,
      ) = reader.read_video_file_into_clips(
          silent_testfile,
          num_frames_per_clip=num_frames_per_clip,
          clips_per_video=clips_per_video,
          is_training=is_training,
          output_video_fps=output_video_fps,
          output_audio_fps=output_audio_fps,
          num_samples_per_clip=num_samples_per_clip,
      ).values()
      assert video.shape == silent_video.shape
      assert (
          metadata["video_frame_timestamps"].shape
          == silent_metadata["video_frame_timestamps"].shape
      )
      assert metadata["video_fps"] == silent_metadata["video_fps"]
      assert silent_audio is None
      assert silent_metadata["audio_fps"] is None
      assert video.shape[0] == audio.shape[0]
      assert metadata["video_frame_timestamps"].shape == (
          video.shape[0],
          video.shape[time_idx],
      )
      assert video.ndim == 5 and audio.ndim == 3
      if is_training:
          assert (
              video.shape[0] == clips_per_video * num_samples_per_clip
          )
      else:
          assert video.shape[0] == clips_per_video
      assert video.shape[time_idx] == num_frames_per_clip
      assert video.shape[channel_idx] == video_channels
      assert (
          video.shape[time_idx]
          - audio.shape[1]
          * metadata["video_fps"]
          / metadata["audio_fps"]
          < 1,
          "Audio and video are of different lengths in seconds.",
      )
      if output_video_fps > 0:
          assert metadata["video_fps"] == output_video_fps
      if output_audio_fps > 0:
          assert metadata["audio_fps"] == output_audio_fps
  
imports: import sys
  import pytest
  import torch
  from data.video_reader.decord_reader import DecordAVReader
  from data.video_reader.pyav_reader import PyAVReader
  from tests.configs import get_config
label_desc: Use image node_id 1 for calling a global function with example usage: test_video_reader_clips(reader_class, num_frames_per_clip, clips_per_video, is_training, output_video_fps, output_audio_fps, num_samples_per_clip, frame_stack_format) without return types