def sample_wr(population, k):
    "from http://code.activestate.com/recipes/273085-sample-with-replacement"
    n = len(population)
    _random, _int = random.random, int  # speed hack 
    result = [None] * k
    for i in xrange(k):
        j = _int(_random() * n)
        result[i] = population[j]
    return result

# ------------------------------------------------
# import data from json
Chooses k random elements (with replacement) from a population
dataset/ETHPy150Open tomstafford/axongame/sup_ee_boot.py/sample_wr