docstr: Returns any of the next pending results.
  This returns some result produced by :py:meth:`alibi.utils.distributed.ActorPool.submit()`, blocking for up to
  the specified timeout until it is available. Unlike :py:meth:`alibi.utils.distributed.ActorPool.get_next()`,
  the results are not always returned in same order as submitted, which can improve performance.
  
  Returns
  -------
  The next result.
  
  Raises
  ------
  `TimeoutError` if the timeout is reached.
  
  Examples
  --------
  >>> pool = ActorPool(...)
  >>> pool.submit(lambda a, v: a.double.remote(v), 1)
  >>> pool.submit(lambda a, v: a.double.remote(v), 2)
  >>> print(pool.get_next_unordered())
  4
  >>> print(pool.get_next_unordered())
  2
code: def get_next_unordered(self, timeout=None):
      """
      Returns any of the next pending results.
      This returns some result produced by :py:meth:`alibi.utils.distributed.ActorPool.submit()`, blocking for up to
      the specified timeout until it is available. Unlike :py:meth:`alibi.utils.distributed.ActorPool.get_next()`,
      the results are not always returned in same order as submitted, which can improve performance.
  
      Returns
      -------
      The next result.
  
      Raises
      ------
      `TimeoutError` if the timeout is reached.
  
      Examples
      --------
      >>> pool = ActorPool(...)
      >>> pool.submit(lambda a, v: a.double.remote(v), 1)
      >>> pool.submit(lambda a, v: a.double.remote(v), 2)
      >>> print(pool.get_next_unordered())
      4
      >>> print(pool.get_next_unordered())
      2
      """
      if not self.has_next():
          raise StopIteration("No more results to get")
      res, _ = ray.wait(
          list(self._future_to_actor), num_returns=1, timeout=timeout
      )
      if res:
          [future] = res
      else:
          raise TimeoutError("Timed out waiting for result")
      i, a = self._future_to_actor.pop(future)
      self._return_actor(a)
      del self._index_to_future[i]
      self._next_return_index = max(self._next_return_index, i + 1)
      return ray.get(future)
  
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 7 for calling the ActorPool obj's underlying member method code with example usage: obj.get_next_unordered(timeout) and returns: ray