docstr: Taken fom the `ray` repository: https://github.com/ray-project/ray/pull/5945 .
  Create an actor pool from a list of existing actors.
  An actor pool is a utility class similar to `multiprocessing.Pool` that
  lets you schedule `ray` tasks over a fixed pool of actors.
  
  Parameters
  ----------
  actors
      List of `ray` actor handles to use in this pool.
  
  Examples
  ---------
  >>> a1, a2 = Actor.remote(), Actor.remote()
  >>> pool = ActorPool([a1, a2])
  >>> print(pool.map(lambda a, v: a.double.remote(v), [1, 2, 3, 4]))
  [2, 4, 6, 8]
code: def __init__(self, actors):
      """
      Taken fom the `ray` repository: https://github.com/ray-project/ray/pull/5945 .
      Create an actor pool from a list of existing actors.
      An actor pool is a utility class similar to `multiprocessing.Pool` that
      lets you schedule `ray` tasks over a fixed pool of actors.
  
      Parameters
      ----------
      actors
          List of `ray` actor handles to use in this pool.
  
      Examples
      ---------
      >>> a1, a2 = Actor.remote(), Actor.remote()
      >>> pool = ActorPool([a1, a2])
      >>> print(pool.map(lambda a, v: a.double.remote(v), [1, 2, 3, 4]))
      [2, 4, 6, 8]
      """
      self._idle_actors = list(actors)
      self._future_to_actor = {}
      self._index_to_future = {}
      self._next_task_index = 0
      self._next_return_index = 0
      self._pending_submits = []
  
imports: import copy
  import logging
  from functools import partial
  from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, Union
  import numpy
  from scipy import sparse
  import ray
label_desc: Use image node_id 1 to create a new ActorPool object from inherited base classes: object with example: obj = ActorPool(actors)