

def is_port_listening(port):
    import socket
    s = socket.socket()
    try:
        s.connect(('localhost', port))
    except socket.error:
        return False
    s.close()
    return True

dataset/ETHPy150Open natduca/quickopen/src/temporary_daemon.py is_port_listening/original