'Returns if the connection or any of its callbacks have timed out.'

def check_timeouts(self):

    now = time.time()
    if ((now - self.last_used) > self.CLIENT_TIMEOUT):
        return False
    for callback in self.queries.values():
        if ((now >= (callback.start + callback.timeout)) and (callback.timeout != 0)):
            return False
    return True
