def METHOD_NAME(check, kwcheck=None):
    assert check
    assert kwcheck
    nonlocal failcounter
    if failcounter < ncausefailure:
        time.sleep(faildelay)
        failcounter += 1
        raise retry.RetryError
    yield True