code: def __init__(
      self,
      generator,
      generator_params,
      output_types,
      output_shapes,
      num_parallel_calls,
      batch_size,
      take,
  ):
      ctx = mp.get_context("spawn")
      self._q = ctx.Queue(maxsize=num_parallel_calls)
      self._output_types = output_types
      self._take = take
      self._count = 0
  
      self._p_list = []
  
      for i in range(num_parallel_calls):
          self._p_list.append(
              ctx.Process(
                  target=_process,
                  args=(
                      self._q,
                      generator,
                      generator_params,
                      output_shapes,
                      batch_size,
                  ),
              )
          )
          self._p_list[i].daemon = True
          self._p_list[i].start()
  
imports: import multiprocessing
  import tensorflow
  import numpy
  import random
label_desc: Use image node_id 1 to create a new _ParallelDataset object  with example: obj = _ParallelDataset(generator, generator_params, output_types, output_shapes, num_parallel_calls, batch_size, take)