code: def get_videos():
      batch_size = 64
      num_vids = 4
      step = batch_size // num_vids
  
      def get_size(sample_info):
          size = (sample_info.idx_in_batch // step) * 25 + 200
          return np.array([size, size + 7], dtype=np.float32)
  
      @pipeline_def(batch_size=64, num_threads=4, device_id=0)
      def pipeline():
          image, _ = fn.readers.file(
              name="Reader", file_root=images_dir
          )
          size = fn.external_source(source=get_size, batch=False)
          image = fn.decoders.image(image, device="cpu")
          return fn.resize(image, size=size)
  
      p = pipeline()
      p.build()
      (out,) = p.run()
  
      out = [np.array(sample) for sample in out]
      vids = [
          np.stack([out[i * step + j] for j in range(step)])
          for i in range(num_vids)
      ]
  
      def inner():
          return fn.external_source(
              source=lambda source_info: vids[
                  source_info.idx_in_batch % len(vids)
              ],
              batch=False,
              layout="FHWC",
          )
  
      return inner
  
imports: import itertools
  import os
  import numpy
  from PIL import Image, ImageEnhance, ImageOps
  from nose2.tools import params, cartesian_params
  import nvidia.dali.tensors
  from nvidia.dali import fn, pipeline_def
  from nvidia.dali.auto_aug import augmentations
  from nvidia.dali.auto_aug.core._utils import get_translations
  from test_utils import get_dali_extra_path, check_batch
label_desc: Use image node_id 6 for calling a global function with example usage: get_videos() and returns: inner, np, fn, fn