code: def create_ref_pipe(
      channel_first, seq_len, interp, dtype, w, h, batch_size=2
  ):
      pipe = dali.pipeline.Pipeline(
          batch_size, 1, 0, 0, exec_async=False, exec_pipelined=False
      )
      with pipe:
          layout = "FCHW" if channel_first else "FHWC"
          ext = fn.external_source(
              GetSequences(channel_first, seq_len, batch_size),
              layout=layout,
          )
          pil_resized = fn.python_function(
              ext,
              function=resize_PIL(channel_first, interp, w, h),
              batch_processing=False,
          )
          if (
              dtype is not None
          ):  # unfortunately, PIL can't quite handle that
              pil_resized = fn.cast(pil_resized, dtype=dtype)
          pil_resized = fn.reshape(pil_resized, layout=layout)
          pipe.set_outputs(pil_resized)
      return pipe
  
file_path: DALI/dali/test/python/operator_2/test_resize_seq.py
imports: import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.types
  import numpy
  import os.path
  from test_utils import check_batch
  import PIL.Image
label_desc: Use image node_id 4 for calling a global function with example usage: create_ref_pipe(channel_first, seq_len, interp, dtype, w, h, batch_size) and returns: pipe