class_docstr: Wrapper around ``multiprocessing.Pool`` for multicore augmentation.
  
  Parameters
  ----------
  augseq : imgaug.augmenters.meta.Augmenter
      The augmentation sequence to apply to batches.
  
  processes : None or int, optional
      The number of background workers, similar to the same parameter in
      multiprocessing.Pool. If ``None``, the number of the machine's CPU
      cores will be used (this counts hyperthreads as CPU cores). If this is
      set to a negative value ``p``, then ``P - abs(p)`` will be used,
      where ``P`` is the number of CPU cores. E.g. ``-1`` would use all
      cores except one (this is useful to e.g. reserve one core to feed
      batches to the GPU).
  
  maxtasksperchild : None or int, optional
      The number of tasks done per worker process before the process is
      killed and restarted, similar to the same parameter in
      multiprocessing.Pool. If ``None``, worker processes will not be
      automatically restarted.
  
  seed : None or int, optional
      The seed to use for child processes. If ``None``, a random seed will
      be used.
docstr: Return or create the ``multiprocessing.Pool`` instance.
  
  This creates a new instance upon the first call and afterwards
  returns that instance (until the property ``_pool`` is set to
  ``None`` again).
  
  Returns
  -------
  multiprocessing.Pool
      The ``multiprocessing.Pool`` used internally by this
      ``imgaug.multicore.Pool``.
docstr_tok: ["Return","or","create","the","``","multiprocessing.Pool","``","instance",".","This","creates","a","new","instance","upon","the","first","call","and","afterwards","returns","that","instance","(","until","the","property","``","_pool","``","is","set","to","``","None","``","again",")",".","Returns","--","--","--","-","multiprocessing.Pool","The","``","multiprocessing.Pool","``","used","internally","by","this","``","imgaug.multicore.Pool","``","."]
code: def pool(self):
      """Return or create the ``multiprocessing.Pool`` instance.
  
      This creates a new instance upon the first call and afterwards
      returns that instance (until the property ``_pool`` is set to
      ``None`` again).
  
      Returns
      -------
      multiprocessing.Pool
          The ``multiprocessing.Pool`` used internally by this
          ``imgaug.multicore.Pool``.
  
      """
      if self._pool is None:
          processes = self.processes
          if processes is not None and processes < 0:
              # cpu count returns the number of logical cpu cores, i.e.
              # including hyperthreads could also use
              # os.sched_getaffinity(0) here, which seems to not exist on
              # BSD though.
              # In python 3.4+, there is also os.cpu_count(), which
              # multiprocessing.cpu_count() then redirects to.
              # At least one guy on stackoverflow.com/questions/1006289
              # reported that only os.* existed, not the multiprocessing
              # method.
              # TODO make this also check if os.cpu_count exists as a
              #      fallback
              try:
                  processes = _get_context().cpu_count() - abs(
                      processes
                  )
                  processes = max(processes, 1)
              except (ImportError, NotImplementedError):
                  ia.warn(
                      "Could not find method multiprocessing.cpu_count(). "
                      "This will likely lead to more CPU cores being used "
                      "for the background augmentation than originally "
                      "intended."
                  )
                  processes = None
  
          self._pool = _get_context().Pool(
              processes,
              initializer=_Pool_initialize_worker,
              initargs=(self.augseq, self.seed),
              maxtasksperchild=self.maxtasksperchild,
          )
      return self._pool
  
imports: from __future__ import print_function, division, absolute_import
  import sys
  import multiprocessing
  import threading
  import traceback
  import time
  import random
  import platform
  import numpy
  import cv2
  import imgaug.imgaug
  import imgaug.random
  from imgaug.augmentables.batches import Batch, UnnormalizedBatch
label_desc: Use image node_id 2 for calling the Pool obj's underlying member method code with example usage: obj.pool() and returns: self