class_docstr: Processor class for parallel processing of data.
  
  Parameters
  ----------
  processors : list
      Processor instances to be processed in parallel.
  num_threads : int, optional
      Number of parallel working threads.
  
  Notes
  -----
  If the `processors` list contains lists or tuples, these get wrapped as a
  :class:`SequentialProcessor`.
class_docstr_tok: ["Processor","class","for","parallel","processing","of","data",".","Parameters","--","--","--","--","--","processors",":","list","Processor","instances","to","be","processed","in","parallel",".","num_threads",":","int",",","optional","Number","of","parallel","working","threads",".","Notes","--","--","-","If","the","`","processors","`","list","contains","lists","or","tuples",",","these","get","wrapped","as","a",":","class",":","`","SequentialProcessor","`","."]
code: def __init__(self, processors, num_threads=None):
      # set the processing chain
      super(ParallelProcessor, self).__init__(processors)
      # number of threads
      if num_threads is None:
          num_threads = 1
      # Note: we must define the map function here, otherwise it leaks both
      #       memory and file descriptors if we init the pool in the process
      #       method. This also means that we must use only 1 thread if we
      #       want to pickle the Processor, because map is pickle-able,
      #       whereas mp.Pool().map is not.
      self.map = map
      if min(len(processors), max(1, num_threads)) > 1:
          self.map = mp.Pool(num_threads).map
  
imports: from __future__ import absolute_import, division, print_function
  import argparse
  import itertools
  import multiprocessing
  import os
  import sys
  from collections.abc import MutableSequence
  import numpy
  from .utils import integer_types
label_desc: Use image node_id 1 to create a new ParallelProcessor object from inherited base classes: SequentialProcessor with example: obj = ParallelProcessor(processors, num_threads)