code: def _parse_host_files(filename):
      """Transform the hostfile into a format of <IP address> or <host name>:<Number of GPUs>
  
      Args:
          filename: Should contains only <IP address> or <host name> slots=<number of GPUs>
      Returns:
          Comma separated string of <IP address> or <host name>:<Number of GPUs>
      """
      hosts = []
      for line in open(filename):
          line = line.rstrip()
          hostname = line.split()[0]
          slots = line.split("=")[1]
          hosts.append(
              "{name}:{slots}".format(name=hostname, slots=slots)
          )
  
      return ",".join(hosts)
  
file_path: bluefog/bluefog/run/network_util.py
imports: import concurrent.futures
  import io
  import os
  import re
  import socket
  import psutil
  from bluefog.run.horovodrun.common.util import safe_shell_exec
label_desc: Use image node_id 2 for calling a global function with example usage: _parse_host_files(filename) and returns: str