code: def _starmap_with_kwargs(pool, fn, args_iter, kwargs_iter):
      # Helper function to allow kwargs with Pool.starmap
      # Copied from https://stackoverflow.com/a/53173433/13311693
      args_for_starmap = zip(repeat(fn), args_iter, kwargs_iter)
      return pool.starmap(_apply_args_and_kwargs, args_for_starmap)
  
imports: import logging
  import multiprocessing
  import time
  import warnings
  from collections import defaultdict
  from itertools import repeat
  from typing import Any, Dict, Optional, Tuple, Union
  import cloudpickle
  import numpy
  from arviz import InferenceData
  from fastprogress.fastprogress import progress_bar
  import pymc
  from pymc.backends.arviz import dict_to_dataset, to_inference_data
  from pymc.backends.base import MultiTrace
  from pymc.model import Model, modelcontext
  from pymc.sampling.parallel import _cpu_count
  from pymc.smc.kernels import IMH
  from pymc.stats.convergence import log_warnings, run_convergence_checks
  from pymc.util import RandomState, _get_seeds_per_chain
label_desc: Use image node_id 6 for calling a global function with example usage: _starmap_with_kwargs(pool, fn, args_iter, kwargs_iter) and returns: pool