def continuants(contfrac):
    p0 = 1.
    q0 = 0.
    p = 0.
    q = 1.
    for n, d in contfrac:
        p0, q0, p, q = p, q, d*p + n*p0, d*q + n*q0
        if p >= EPSINV or q >= EPSINV:
            p0 *= EPSILON
            q0 *= EPSILON
            p *= EPSILON
            q *= EPSILON
        assert q != 0
        yield p, q
Test that the q and v values update
dataset/ETHPy150Open probcomp/bayeslite/src/math_util.py/continuants--crossover with--dataset/ETHPy150Open Axelrod-Python/Axelrod/axelrod/tests/unit/test_qlearner.py/TestArrogantQLearner.test_prev_state_updates