code: def _test_multiple_stateful_sources_single_worker(num_workers):
      groups = [
          MockGroup.from_callback(IteratorCb(), batch=True),
          MockGroup.from_callback(IteratorCb(), batch=True),
      ]
      with create_pool(
          groups,
          keep_alive_queue_size=1,
          num_workers=num_workers,
          start_method="spawn",
      ) as pool:
          pids = get_pids(pool)
          assert len(pids) == min(num_workers, len(groups))
          pool.schedule_batch(
              context_i=0, work_batch=TaskArgs.make_batch((0,))
          )
          pool.schedule_batch(
              context_i=1, work_batch=TaskArgs.make_batch((0,))
          )
          iter_worker_num_0 = pool.contexts[0].dedicated_worker_id
          iter_worker_num_1 = pool.contexts[1].dedicated_worker_id
          iter_worker_pid_0 = pool.pool._processes[
              iter_worker_num_0
          ].pid
          iter_worker_pid_1 = pool.pool._processes[
              iter_worker_num_1
          ].pid
          batch_0 = pool.receive_batch(context_i=0)
          batch_1 = pool.receive_batch(context_i=1)
          np.testing.assert_array_equal(
              np.array([iter_worker_pid_0, 1]), batch_0[0]
          )
          np.testing.assert_array_equal(
              np.array([iter_worker_pid_1, 1]), batch_1[0]
          )
          if num_workers == 1:
              assert iter_worker_pid_0 == iter_worker_pid_1
          else:
              assert iter_worker_pid_0 != iter_worker_pid_1
  
imports: from nvidia.dali._multiproc.pool import WorkerPool
  from nvidia.dali._multiproc.messages import TaskArgs, SampleRange
  from contextlib import closing
  from nvidia.dali._utils.external_source_impl import get_callback_from_source
  from nvidia.dali.types import SampleInfo
  from functools import wraps
  import numpy
  import os
  from nose.tools import with_setup
  from nose_utils import raises
  from test_pool_utils import capture_processes, setup_function, teardown_function
label_desc: Use image node_id 15 for calling a global function with example usage: _test_multiple_stateful_sources_single_worker(num_workers) without return types