def _weighted_sampling_without_replacement(population, weights, k):
    '\n    Source:\n        Weighted random sampling with a reservoir, Pavlos S. Efraimidis, Paul G. Spirakis\n    '
    elt = [((math.log(rnd.random()) / weights[i]), i) for i in range(len(weights))]
    return [population[x[1]] for x in heapq.nlargest(k, elt)]
Source:
    Weighted random sampling with a reservoir, Pavlos S. Efraimidis, Paul G. Spirakis
def _weighted_sampling_without_replacement(population, weights, k):
    '\n    Source:\n        Weighted random sampling with a reservoir, Pavlos S. Efraimidis, Paul G. Spirakis\n    '
    elt = [((math.log(rnd.random()) / weights[i]), i) for i in range(len(weights))]
    return [population[x[1]] for x in heapq.nlargest(k, elt)]