def wait_pass(raising_predicate, expected=Exception, interval=5, timeout=None):
    """Wait for successful return from predicate or expected exception"""
    start_time = time.time()
    while True:
        try:
            return raising_predicate()
        except expected:
            if timeout and time.time() < start_time + timeout:
                raise
            time.sleep(interval)
dataset/ETHPy150Open openstack/fuel-devops/devops/helpers/helpers.py/wait_pass/swapped operands of `<`