class_docstr: Event manager for Ray futures.
  
  The event manager can be used to track futures and invoke callbacks when
  they resolve.
  
  Futures are tracked with :meth:`track_future`. Future can then be awaited with
  :meth:`wait`. When futures successfully resolve, they trigger an optional
  ``on_result`` callback that can be passed to :meth:`track_future`. If they
  fail, they trigger an optional ``on_error`` callback.
  
  Args:
      shuffle_futures: If True, futures will be shuffled before awaited. This
          will avoid implicit prioritization of futures within Ray.
docstr: Wait up to ``timeout`` seconds for ``num_results`` futures to resolve.
  
  If ``timeout=None``, this method will block until all `num_results`` futures
  resolve. If ``num_results=None``, this method will await all tracked futures.
  
  For every future that resolves, the respective associated callbacks will be
  invoked.
  
  Args:
      timeout: Timeout in second to wait for futures to resolve.
      num_results: Number of futures to await. If ``None``, will wait for
          all tracked futures to resolve.
code: def wait(
      self,
      timeout: Optional[Union[float, int]] = None,
      num_results: Optional[int] = 1,
  ):
      """Wait up to ``timeout`` seconds for ``num_results`` futures to resolve.
  
      If ``timeout=None``, this method will block until all `num_results`` futures
      resolve. If ``num_results=None``, this method will await all tracked futures.
  
      For every future that resolves, the respective associated callbacks will be
      invoked.
  
      Args:
          timeout: Timeout in second to wait for futures to resolve.
          num_results: Number of futures to await. If ``None``, will wait for
              all tracked futures to resolve.
  
      """
      futures = list(self.get_futures())
  
      if self._shuffle_futures:
          random.shuffle(futures)
  
      num_results = num_results or len(futures)
  
      ready, _ = ray.wait(
          list(futures), timeout=timeout, num_returns=num_results
      )
      for future in ready:
          self.resolve_future(future)
  
file_path: ray/python/ray/air/execution/_internal/event_manager.py
imports: import random
  import ray
  from typing import Any, Callable, Dict, Iterable, Optional, Set, Tuple, Union
label_desc: Use image node_id 8 for calling the RayEventManager obj's underlying member method code with example usage: obj.wait(timeout, num_results) without return types