code: def test_debayer_vid_per_frame_pattern(self):
      num_iterations = 2
      batch_size = (self.num_samples + 1) // 2
  
      def source(sample_info):
          idx = sample_info.idx_in_epoch % self.num_samples
          vid = self.bayered_vid[idx]
          return (
              vid,
              self.blue_poses[idx],
              np.array(idx, dtype=np.int32),
          )
  
      @pipeline_def
      def debayer_pipeline():
          bayered_vid, blue_positions, idxs = fn.external_source(
              source=source,
              batch=False,
              num_outputs=3,
              layout=["FHW", None, None],
          )
          debayered_vid = fn.experimental.debayer(
              bayered_vid.gpu(),
              blue_position=fn.per_frame(blue_positions),
          )
          return debayered_vid, idxs
  
      pipe = debayer_pipeline(
          batch_size=batch_size, device_id=0, num_threads=4
      )
      pipe.build()
  
      out_batches = []
      for _ in range(num_iterations):
          debayered_dev, idxs = pipe.run()
          assert debayered_dev.layout() == "FHWC"
          out_batches.append(
              (
                  [np.array(vid) for vid in debayered_dev.as_cpu()],
                  [np.array(idx) for idx in idxs],
              )
          )
  
      for debayered_videos, idxs in out_batches:
          assert len(debayered_videos) == len(idxs)
          for vid_debayered, idx in zip(debayered_videos, idxs):
              baseline = self.npp_baseline[idx]
              assert np.all(vid_debayered == baseline)
  
imports: import itertools
  import os
  import unittest
  import numpy
  from nvidia.dali import pipeline_def, fn, types
  from test_utils import get_dali_extra_path
  from nose_utils import assert_raises
  from nose2.tools import params
  from debayer_test_utils import bayer_patterns, blue_position, blue_position2pattern, rgb2bayer, rgb2bayer_seq, debayer_bilinear_npp_pattern, debayer_bilinear_npp_pattern_seq
label_desc: Use image node_id 2 for calling the DebayerVideoTest obj's underlying member method code with example usage: obj.test_debayer_vid_per_frame_pattern() and returns: vid,  self,  np, debayered_vid,  idxs