MCPcopy Index your code
hub / github.com/python/cpython / test_sample_on_seqsets

Method test_sample_on_seqsets

Lib/test/test_random.py:189–203  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

187 self.gen.sample(population, k=5)
188
189 def test_sample_on_seqsets(self):
190 class SeqSet(abc.Sequence, abc.Set):
191 def __init__(self, items):
192 self._items = items
193
194 def __len__(self):
195 return len(self._items)
196
197 def __getitem__(self, index):
198 return self._items[index]
199
200 population = SeqSet([2, 4, 1, 3])
201 with warnings.catch_warnings():
202 warnings.simplefilter("error", DeprecationWarning)
203 self.gen.sample(population, k=2)
204
205 def test_sample_with_counts(self):
206 sample = self.gen.sample

Callers

nothing calls this directly

Calls 2

SeqSetClass · 0.85
sampleMethod · 0.45

Tested by

no test coverage detected