qiskit/_util.py
def _has_connection(hostname, port):
    """Checks to see if internet connection exists to host
    via specified port

    Args:
        hostname (str): Hostname to connect to.
        port (int): Port to connect to

    Returns:
        bool: Has connection or not

    Raises:
        gaierror: No connection established.
    """
    try:
        host = socket.gethostbyname(hostname)
        socket.create_connection((host, port), 2)
        return True
    except socket.gaierror:
        pass
    return False
Checks to see if internet connection exists to host
    via specified port

    Args:
        hostname (str): Hostname to connect to.
        port (int): Port to connect to

    Returns:
        bool: Has connection or not

    Raises:
        gaierror: No connection established.
    
Checks to see if internet connection exists to host
via specified port
Checks to see if internet connection exists to host via specified port
def _has_connection(hostname, port):
    try:
        host = socket.gethostbyname(hostname)
        socket.create_connection((host, port), 2)
        return True
    except socket.gaierror:
        pass
    return False
def _has_connection ( hostname , port ) : try : host = socket . gethostbyname ( hostname ) socket . create_connection ( ( host , port ) , 2 ) return True except socket . gaierror : pass return False
Checks to see if internet connection exists to host
via specified port
Checks to see if internet connection exists to host via specified port
"""Checks to see if internet connection exists to host
    via specified port

    Args:
        hostname (str): Hostname to connect to.
        port (int): Port to connect to

    Returns:
        bool: Has connection or not

    Raises:
        gaierror: No connection established.
    """
Has connection or not
Has connection or not
bool
No connection established.
No connection established .
gaierror
hostname
Hostname to connect to.
Hostname to connect to .
port
Port to connect to
Port to connect to