Lines Matching refs:population
282 def sample(self, population, k): argument
310 if isinstance(population, _Set):
311 population = tuple(population)
312 if not isinstance(population, _Sequence):
315 n = len(population)
324 pool = list(population)
337 result[i] = population[j]
340 def choices(self, population, weights=None, *, cum_weights=None, k=1): argument
351 total = len(population)
352 return [population[_int(random() * total)] for i in range(k)]
356 if len(cum_weights) != len(population):
360 return [population[bisect(cum_weights, random() * total)] for i in range(k)]