code: def _check_spawn_with_callback(
      callback,
      callback_ref,
      batch_size,
      num_outputs,
      layout,
      workers_num,
      epoch_size,
      dtype,
  ):
      pipe_parallel = create_pipe(
          callback,
          "cpu",
          batch_size,
          py_num_workers=workers_num,
          py_start_method="spawn",
          parallel=True,
          num_outputs=num_outputs,
          layout=layout,
      )
      pipe = create_pipe(
          callback_ref,
          "cpu",
          batch_size,
          parallel=False,
          num_outputs=num_outputs,
          layout=layout,
      )
      check_callback(pipe_parallel, pipe, epoch_size, batch_size, dtype)
  
imports: import numpy
  import nvidia.dali
  from nose.tools import with_setup
  from test_pool_utils import capture_processes, teardown_function, setup_function
  from test_utils import compare_pipelines, check_batch, RandomDataIterator, RandomlyShapedDataIterator
label_desc: Use image node_id 4 for calling a global function with example usage: _check_spawn_with_callback(callback, callback_ref, batch_size, num_outputs, layout, workers_num, epoch_size, dtype) without return types