def parse_netloc(netloc):
    # type: (str) -> Tuple[str, Optional[int]]
    """
    Return the host-port pair from a netloc.
    """
    url = build_url_from_netloc(netloc)
    parsed = urllib_parse.urlparse(url)
    return parsed.hostname, parsed.port

    Return the host-port pair from a netloc.
    
product/gradle-plugin/src/main/python/pip/_internal/utils/misc.py