MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_sample_on_seqsets

Method test_sample_on_seqsets

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

SeqSetClass · 0.85
sampleMethod · 0.80

Tested by

no test coverage detected