code: def __init__(
      self,
      *,
      draws: int,
      tune: int,
      chains: int,
      cores: int,
      seeds: Sequence["RandomSeed"],
      start_points: Sequence[Dict[str, np.ndarray]],
      step_method,
      progressbar: bool = True,
      mp_ctx=None,
  ):
      if any(len(arg) != chains for arg in [seeds, start_points]):
          raise ValueError(
              "Number of seeds and start_points must be %s." % chains
          )
  
      if mp_ctx is None or isinstance(mp_ctx, str):
          # Closes issue https://github.com/pymc-devs/pymc/issues/3849
          # Related issue https://github.com/pymc-devs/pymc/issues/5339
          if mp_ctx is None and platform.system() == "Darwin":
              if platform.processor() == "arm":
                  mp_ctx = "fork"
                  logger.debug(
                      "mp_ctx is set to 'fork' for MacOS with ARM architecture. "
                      + "This might cause unexpected behavior with JAX, which is inherently multithreaded."
                  )
              else:
                  mp_ctx = "forkserver"
  
          mp_ctx = multiprocessing.get_context(mp_ctx)
  
      step_method_pickled = None
      if mp_ctx.get_start_method() != "fork":
          step_method_pickled = cloudpickle.dumps(
              step_method, protocol=-1
          )
  
      self._samplers = [
          ProcessAdapter(
              draws,
              tune,
              step_method,
              step_method_pickled,
              chain,
              seed,
              start,
              mp_ctx,
          )
          for chain, seed, start in zip(
              range(chains), seeds, start_points
          )
      ]
  
      self._inactive = self._samplers.copy()
      self._finished: List[ProcessAdapter] = []
      self._active: List[ProcessAdapter] = []
      self._max_active = cores
  
      self._in_context = False
  
      self._progress = None
      self._divergences = 0
      self._total_draws = 0
      self._desc = "Sampling {0._chains:d} chains, {0._divergences:,d} divergences"
      self._chains = chains
      if progressbar:
          self._progress = progress_bar(
              range(chains * (draws + tune)), display=progressbar
          )
          self._progress.comment = self._desc.format(self)
  
imports: import ctypes
  import logging
  import multiprocessing
  import multiprocessing.sharedctypes
  import platform
  import time
  import traceback
  from collections import namedtuple
  from typing import Dict, List, Sequence
  import cloudpickle
  import numpy
  from fastprogress.fastprogress import progress_bar
  from pymc.blocking import DictToArrayBijection
  from pymc.exceptions import SamplingError
  from pymc.util import RandomSeed
label_desc: Use image node_id 1 to create a new ParallelSampler object  with example: obj = ParallelSampler()