def METHOD_NAME(
    hostname: str, timeout: int = 2, logger: Optional[logging.Logger] = None
) -> bool:
    """
    A low latency check for an internet connection.
    :param hostname: Hostname to use for connection check.
    :param timeout: Timeout in seconds for connection check.
    :param logger: If provided, log output for connection failures will be logged to
        this logger with the level DEBUG.
    :returns: Connection availability.
    """
    if urlparse(hostname).scheme not in ["http", "https"]:
        hostname = "http://" + hostname
    try:
        requests.head(hostname, timeout=timeout)
        return True
    except Exception:
        if logger:
            logger.debug("Could not reach %s", hostname, exc_info=True)
        return False