code: def _hosts_to_hosts_spec(hosts):
      host_to_size = {}
      host_and_rank_to_worker_idx = {}
      for i, host in enumerate(hosts):
          if host not in host_to_size:
              host_to_size[host] = 0
          else:
              host_to_size[host] = host_to_size[host] + 1
          host_and_rank_to_worker_idx[(host, host_to_size[host])] = i
  
      for key in host_to_size:
          host_to_size[key] += 1
  
      hosts_spec = [
          "{}:{}".format(key, host_to_size[key]) for key in host_to_size
      ]
      return hosts_spec, host_and_rank_to_worker_idx, host_to_size
  
file_path: analytics-zoo/pyzoo/zoo/orca/learn/horovod/horovod_ray_runner.py
imports: import ray
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: _hosts_to_hosts_spec(hosts) and returns: hosts_spec,  host_and_rank_to_worker_idx,  host_to_size