code: def parse_host_port (host_port):
      
      host, port = urllib.splitport(host_port.strip())
      if port is not None:
          if urlutil.is_numeric_port(port):
              port = int(port)
      return host, port
docs: Parse a host:port string into separate components.