def retryAssert(assertion, args, numRetries=10, sleepInterval=.1, verbose=False):
    '''Retries an assertion over args numRetries times. It should be
    used for things that will eventually become true instead of sleeping

    assertion       :   an assertion function from unittest.TestCase
    args            :   a list of callables to be called every iteration
                        This is to allow for changing values
    numRetries      :   an integer
    '''

    done = False
    retries = 0
    evaluatedArgs = None
    while not done:
        try:
            evaluatedArgs = [x() for x in args]
            if verbose:
                logging.debug('trying to assert %s on %s', assertion, evaluatedArgs)
            assertion(*evaluatedArgs)
            return 
        except Exception as e:
            if retries == numRetries:
                for x in evaluatedArgs:
                    print x
                print "Failed with assertion after %s tries" * numRetries
                raise 
            if verbose:
                logging.debug('retryAssert found exception %s', traceback.format_exc(e))
            retries += 1

            time.sleep(sleepInterval)
dataset/ETHPy150Open ufora/ufora/ufora/util/RetryAssert.py/retryAssert/operator `%` -> `*`