MCPcopy Create free account
hub / github.com/dask/dask / _sample

Function _sample

dask/bag/random.py:113–121  ·  view source on GitHub ↗
(population, k, split_every)

Source from the content-addressed store, hash-verified

111
112
113def _sample(population, k, split_every):
114 if k < 0:
115 raise ValueError("Cannot take a negative number of samples")
116 return population.reduction(
117 partial(_sample_map_partitions, k=k),
118 partial(_sample_reduce, k=k, replace=False),
119 out_type=Bag,
120 split_every=split_every,
121 )
122
123
124def _finalize_sample(reduce_iter, k):

Callers 1

sampleFunction · 0.85

Calls 1

reductionMethod · 0.45

Tested by

no test coverage detected