code: def portion_out_reference_sequence(
      decoder_pipe_out, frames_per_sequence, batch_size
  ):
      """
      A generator, that takes the output from VideoDecoder DALI pipeline. Then, based of the
      provided parameters, it serves sequences one-by-one, which are supposed to be returned
      by VideoInput operator.
      """
      ref_sequence = to_array(decoder_pipe_out[0])[0]
      num_frames = ref_sequence.shape[0]
      n_batches = num_frames // (batch_size * frames_per_sequence)
      ref_sequence = ref_sequence[
          : n_batches * frames_per_sequence * batch_size
      ]
      sh = ref_sequence.shape
      ref_sequence = ref_sequence.reshape(
          n_batches,
          batch_size,
          frames_per_sequence,
          sh[1],
          sh[2],
          sh[3],
      )
      for rs in ref_sequence:
          yield rs
  
file_path: DALI/dali/test/python/input/test_video.py
imports: import glob
  import itertools
  import numpy
  import nvidia.dali.fn
  import nvidia.dali.types
  from nose2.tools import params
  from nose_utils import assert_raises
  from nvidia.dali import pipeline_def
  from test_utils import get_dali_extra_path, to_array
label_desc: Use image node_id 6 for calling a global function with example usage: portion_out_reference_sequence(decoder_pipe_out, frames_per_sequence, batch_size) without return types