code: def run(caller, job, X, y=None, map=True, **kwargs):
      """Utility for running a ParallelProcessing job on a set of callers.
  
      Run is a utility mapping for setting up a ParallelProcessing job and
      executing across a set of callers. By default run executes::
  
          out = mgr.map(caller, job, X, y, **kwargs)
  
      :func:`run` handles temporary parameter changes, for instance running
      a learner with ``proba=True`` that has ``proba=False`` as default.
      Similarly, instances destined to not produce output can be forced to
      yield predictions by passing ``return_preds=True`` as a keyword argument.
  
      .. note:: To run a learner with a ``preprocessing`` dependency, the
          instances need to be wrapped in a :class:`Group` ::
  
              run(Group(learner, transformer), 'predict', X, y)
  
      Parameters
      ----------
      caller: instance, list
          A runnable instance, or a list of instances.
  
      job: str
          type of job to run. One of ``'fit'``, ``'transform'``, ``'predict'``.
  
      X: array-like
          input
  
      y: array-like, optional
          targets
  
      map: bool (default=True)
          whether to run a :func:`ParallelProcessing.map` job. If ``False``,
          will instead run a :func:`ParallelProcessing.stack` job.
  
      **kwargs: optional
          Keyword arguments. :func:`run` searches for
          ``proba`` and ``return_preds`` to temporarily update callers to run
          desired job and return desired output. Other ``kwargs`` are passed
          to either ``map`` or ``stack``.
      """
      flags = set_predict(kwargs)
      flags["__no_output__"] = set_output(kwargs, job, map)
  
      resets = set_flags(caller, flags)
  
      try:
          verbose = max(getattr(caller, "verbose", 0) - 4, 0)
          _backend = getattr(caller, "backend", config.get_backend())
          n_jobs = getattr(caller, "n_jobs", -1)
          with ParallelProcessing(_backend, n_jobs, verbose) as mgr:
              if map:
                  out = mgr.map(caller, job, X, y, **kwargs)
              else:
                  out = mgr.stack(caller, job, X, y, **kwargs)
      finally:
          reset_flags(resets)
      return out
  
file_path: mlens/mlens/parallel/wrapper.py
imports: from ..None import config
  from .base import BaseParallel, OutputMixin
  from .backend import ParallelProcessing
  from ..utils.exceptions import ParallelProcessingError, NotFittedError
label_desc: Use image node_id 6 for calling a global function with example usage: run(caller, job, X, y, map) and returns: out