

def partial_sums(sequence):
    'Sequence of partial sums of a sequence.'
    s = sequence.next()
    (yield s)
    for t in sequence:
        s += t
        (yield s)

dataset/ETHPy150Open probcomp/bayeslite/src/math_util.py partial_sums/original