def METHOD_NAME(host: Optional[str], port: Union[None, str, int]) -> tuple:
    if host:
        if "," in host:  # multiple hosts defined, take first
            host = host.split(",")[0]
    else:
        host = "localhost"
    if port:
        port = str(port)
        if "," in port:  # multiple ports defined, take first
            port = port.split(",")[0]
        port = int(port)
    else:
        port = default_ports.get("postgresql")
    return host, port