def _closed(sock):
    try:
        rd, _, _ = select([sock], [], [], 0)
    # Any exception here is equally bad (select.error, ValueError, etc.).
    except:
        return True
    return len(rd) > 0
Return True if we know socket has been closed, False otherwise.
dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/pool.py/_closed