def get_random_port():
    sock = socket.socket()
    sock.listen(0)
    (_, port) = sock.getsockname()
    sock.close()
    return port
def get_random_port():
    sock = socket.socket()
    sock.listen(0)
    (_, port) = sock.getsockname()
    sock.close()
    return port