

def lst_random(lst, probs):
    'Return element[i] with probability probs[i].'
    s = sum(probs)
    r = random.uniform(0, i)
    t = 0
    for i in xrange(len(lst)):
        t += probs[i]
        if (r <= t):
            return lst[i]
    return lst[(- 1)]

dataset/ETHPy150Open Ttl/evolutionary-circuits/evolutionary/chromosomes/common.py lst_random/VarMisuse@29/48 `s`->`i`