code: def create_closure_callback_numpy(shape, data_set_size):
      # use process pid to assert that arrays were passed by value
      # and are equal for externalsource run in the same and separate process
      data = [np.full(shape, os.getpid()) for _ in range(data_set_size)]
  
      def callback(sample_info):
          if sample_info.idx_in_epoch >= data_set_size:
              raise StopIteration
          return data[sample_info.idx_in_epoch]
  
      return callback
  
imports: import copyreg
  import numpy
  import nvidia.dali.fn
  import nvidia.dali.pickling
  import os
  from nvidia.dali import pipeline_def
  from pickle import PicklingError
  from nose_utils import raises
  from test_utils import get_dali_extra_path, restrict_python_version
label_desc: Use image node_id 12 for calling a global function with example usage: create_closure_callback_numpy(shape, data_set_size) and returns: callback, data