def waitUntilTrue(functionToCheck, timeout, sleepInterval = 0.01):
    t0 = time.time()
    
    while time.time() - t0 < timeout:
        if functionToCheck():
            return True
        time.sleep(sleepInterval)

    return False
Waits for up to 'timeout' seconds for 'functionToCheck' to become True.
dataset/ETHPy150Open ufora/ufora/ufora/util/RetryAssert.py/waitUntilTrue