code: def images_pipeline(dev, shapes, border, in_dtype, mode):
      images, _ = fn.readers.file(
          name="Reader",
          file_root=images_dir,
          prefetch_queue_depth=2,
          random_shuffle=True,
          seed=42,
      )
      images = fn.experimental.decoders.image(
          images,
          device="cpu",
          output_type=types.RGB,
          dtype=np_type_to_dali(in_dtype),
      )
      if dev == "gpu":
          images = images.gpu()
      filters, anchors = fn.external_source(
          source=create_filter_anchor_source(shapes),
          batch=False,
          num_outputs=2,
      )
      fill_val_limit = (
          1
          if not np.issubdtype(in_dtype, np.integer)
          else np.iinfo(in_dtype).max
      )
      fill_values = fn.random.uniform(
          range=[0, fill_val_limit], dtype=np_type_to_dali(in_dtype)
      )
      if border == "constant":
          convolved = fn.experimental.filter(
              images,
              filters,
              fill_values,
              anchor=anchors,
              border=border,
              mode=mode,
          )
      else:
          convolved = fn.experimental.filter(
              images, filters, anchor=anchors, border=border, mode=mode
          )
      return convolved, images, filters, anchors, fill_values
  
file_path: DALI/dali/test/python/operator_2/test_filter.py
imports: import itertools
  import os
  import numpy
  from nvidia.dali import pipeline_def, fn, types
  from test_utils import get_dali_extra_path, np_type_to_dali, check_batch
  from nose2.tools import params
  from nose.plugins.attrib import attr
  from filter_test_utils import filter_baseline, filter_baseline_layout
label_desc: Use image node_id 4 for calling a global function with example usage: images_pipeline(dev, shapes, border, in_dtype, mode) and returns: convolved,  images,  filters,  anchors,  fill_values