code: def test_pool_iterator_dedicated_worker(start_method):
      groups = [
          MockGroup.from_callback(
              simple_callback, prefetch_queue_depth=3
          ),
          MockGroup.from_callback(
              IteratorCb(), prefetch_queue_depth=3, batch=True
          ),
      ]
      with create_pool(
          groups,
          keep_alive_queue_size=1,
          num_workers=4,
          start_method=start_method,
      ) as pool:
          pids = get_pids(pool)
          assert len(pids) == 4
          tasks_list = []
          samples_count = 0
          for i in range(4):
              tasks = [
                  (SampleInfo(samples_count + j, j, i, 0),)
                  for j in range(i + 1)
              ]
              tasks_list.append(tasks)
              work_batch = TaskArgs.make_sample(
                  SampleRange(
                      samples_count, samples_count + i + 1, i, 0
                  )
              )
              samples_count += len(tasks)
              pool.schedule_batch(context_i=0, work_batch=work_batch)
              pool.schedule_batch(
                  context_i=1, work_batch=TaskArgs.make_batch((i,))
              )
          assert pool.contexts[0].dedicated_worker_id is None
          iter_worker_num = pool.contexts[1].dedicated_worker_id
          iter_worker_pid = pool.pool._processes[iter_worker_num].pid
          for i in range(4):
              batch_0 = pool.receive_batch(context_i=0)
              batch_1 = pool.receive_batch(context_i=1)
              tasks = tasks_list[i]
              assert len(batch_0) == len(tasks)
              assert len(batch_1) == len(tasks)
              for task, sample in zip(tasks, batch_0):
                  np.testing.assert_array_equal(
                      answer(-1, *task)[1:], sample[1:]
                  )
              for sample in batch_1:
                  np.testing.assert_array_equal(
                      np.array([iter_worker_pid, i + 1]), sample
                  )
  
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 12 for calling a global function with example usage: test_pool_iterator_dedicated_worker(start_method) without return types