class_docstr: Uses Ray global state to obtain host mapping.
  
  Assumes that the whole global state is available for usage.
code: def __init__(self, use_gpu=False, cpus_per_slot=1, gpus_per_slot=1):
      self.use_gpu = use_gpu
      self.cpus_per_slot = cpus_per_slot
      self.gpus_per_slot = gpus_per_slot
      logger.debug(
          f"Discovery started with {cpus_per_slot} CPU / "
          f"{gpus_per_slot} GPU per slot."
      )
  
imports: from typing import Callable, List, Any, Dict, Optional
  import logging
  import socket
  import time
  import os
  import random
  import math
  import threading
  import warnings
  from horovod.runner.common.util import timeout, secret
  from horovod.runner.http.http_server import RendezvousServer
  from horovod.runner.gloo_run import create_slot_env_vars, create_run_env_vars, _get_min_start_hosts
  from horovod.runner.elastic.settings import ElasticSettings
  from horovod.runner.elastic.rendezvous import create_rendezvous_handler
  from horovod.runner.elastic.discovery import HostDiscovery
  from horovod.runner.elastic.driver import ElasticDriver
  import ray
  import ray.exceptions
  from horovod.ray.worker import BaseHorovodWorker
  from horovod.ray.utils import detect_nics
label_desc: Use image node_id 1 to create a new RayHostDiscovery object from inherited base classes: HostDiscovery with example: obj = RayHostDiscovery(use_gpu, cpus_per_slot, gpus_per_slot)