def wait_for_condition(condition, timeout=2.0):
    """
    Helper to wait for a condition with a timeout.
    :param float condition:
        Timeout to reach condition (in seconds).

    :return bool:
        True if the condition wasn't satisfied and True if it was.
    """
    import time
    initial = time.time()
    while not condition():
        if time.time() - initial > timeout:
            return False
        time.sleep(0.01)
    return True
