def is_connection_dropped(conn):  # Platform-specific
    sock = getattr(conn, 'sock', False)
    if not sock: # Platform-specific: AppEngine
        return False

    if not poll:
        if not select: # Platform-specific: AppEngine
            return False

        try:
            return select([sock], [], [], 0.0)[0]
        except SocketError:
            return True

    # This version is better on platforms that support it.
    p = poll()
    p.register(sock, POLLIN)
    for (fno, ev) in p.poll(0.0):
        if fno == sock.fileno():
            # Either data is buffered (bad), or the connection is dropped.
            return True
Returns True if the connection is dropped and should be closed.
dataset/ETHPy150Open Bolton-and-Menk-GIS/restapi/restapi/requests/packages/urllib3/util.py/is_connection_dropped