code: def create_sample_source(shapes, dtype):
      rng = np.random.default_rng(42)
      if not np.issubdtype(dtype, np.integer):
          low, high = 0, 1
      else:
          type_info = np.iinfo(dtype)
          low, high = type_info.min, type_info.max
  
      def source(sample_info):
          shape_idx = sample_info.idx_in_batch % len(shapes)
          shape = shapes[shape_idx]
          return dtype(rng.uniform(low, high, shape))
  
      return source
  
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 3 for calling a global function with example usage: create_sample_source(shapes, dtype) and returns: source, dtype