Lines Matching refs:population
286 def sample(self, population, k): argument
314 if isinstance(population, _Set):
315 population = tuple(population)
316 if not isinstance(population, _Sequence):
319 n = len(population)
328 pool = list(population)
341 result[i] = population[j]
344 def choices(self, population, weights=None, *, cum_weights=None, k=1): argument
355 total = len(population)
356 return [population[_int(random() * total)] for i in range(k)]
360 if len(cum_weights) != len(population):
365 return [population[bisect(cum_weights, random() * total, 0, hi)]