class_docstr: Ray backend uses ray, a system for scalable distributed computing.
  More info about Ray is available here: https://docs.ray.io.
class_docstr_tok: ["Ray","backend","uses","ray",",","a","system","for","scalable","distributed","computing",".","More","info","about","Ray","is","available","here",":","https",":","\/\/docs.ray.io","."]
docstr: Make Ray Pool the father class of PicklingPool. PicklingPool is a
  father class that inherits Pool from multiprocessing.pool. The next
  line is a patch, which changes the inheritance of Pool to be from
  ray.util.multiprocessing.pool.
  
  ``ray_remote_args`` will be used to configure Ray Actors making up the pool.
  This will override ``ray_remote_args`` set during initialization.
docstr_tok: ["Make","Ray","Pool","the","father","class","of","PicklingPool",".","PicklingPool","is","a","father","class","that","inherits","Pool","from","multiprocessing.pool",".","The","next","line","is","a","patch",",","which","changes","the","inheritance","of","Pool","to","be","from","ray.util.multiprocessing.pool",".","``","ray_remote_args","``","will","be","used","to","configure","Ray","Actors","making","up","the","pool",".","This","will","override","``","ray_remote_args","``","set","during","initialization","."]
code: def configure(
      self,
      n_jobs: int = 1,
      parallel: Optional[Parallel] = None,
      prefer: Optional[str] = None,
      require: Optional[str] = None,
      ray_remote_args: Optional[Dict[str, Any]] = None,
      **memmappingpool_args,
  ):
      """Make Ray Pool the father class of PicklingPool. PicklingPool is a
      father class that inherits Pool from multiprocessing.pool. The next
      line is a patch, which changes the inheritance of Pool to be from
      ray.util.multiprocessing.pool.
  
      ``ray_remote_args`` will be used to configure Ray Actors making up the pool.
      This will override ``ray_remote_args`` set during initialization.
      """
      PicklingPool.__bases__ = (Pool,)
      """Use all available resources when n_jobs == -1. Must set RAY_ADDRESS
          variable in the environment or run ray.init(address=..) to run on
          multiple nodes.
          """
      if n_jobs == -1:
          if not ray.is_initialized():
              import os
  
              if "RAY_ADDRESS" in os.environ:
                  logger.info(
                      "Connecting to ray cluster at address='{}'".format(
                          os.environ["RAY_ADDRESS"]
                      )
                  )
              else:
                  logger.info("Starting local ray cluster")
              ray.init()
          ray_cpus = int(ray._private.state.cluster_resources()["CPU"])
          n_jobs = ray_cpus
  
      eff_n_jobs = super(RayBackend, self).configure(
          n_jobs,
          parallel,
          prefer,
          require,
          ray_remote_args=ray_remote_args
          if ray_remote_args is not None
          else self.ray_remote_args,
          **memmappingpool_args,
      )
      return eff_n_jobs
  
file_path: ray/python/ray/util/joblib/ray_backend.py
imports: import logging
  from typing import Any, Dict, Optional
  from joblib import Parallel
  from joblib._parallel_backends import MultiprocessingBackend
  from joblib.pool import PicklingPool
  import ray
  from ray._private.usage import usage_lib
  from ray.util.multiprocessing.pool import Pool
label_desc: Use image node_id 2 for calling the RayBackend obj's underlying member method code with example usage: obj.configure(n_jobs, parallel, prefer, require, ray_remote_args) and returns: eff_n_jobs