import socket


def _connected(host: str = "8.8.8.8", port: int = 53, timeout: int = 2) -> bool:
    """
    Determine if internet connectivity is available.

    :param host: The host used to test connectivity
    :type host: str
    :param port: The port used to test connectivity
    :type port: int
    :param timeout: The connection timeout
    :type timeout: int

    :return `True` if connected to the internet, `False` otherwise
    :rtype: bool
    """
    try:
        socket.setdefaulttimeout(timeout)
        socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, port))
        return True
    except socket.error:
        return False