Samples k items using uniform sampling without replacement.
(pool: Sequence[Any], max_num_items: int)
| 18 | |
| 19 | |
| 20 | def uniform_sample(pool: Sequence[Any], max_num_items: int) -> Sequence[Any]: |
| 21 | """Samples k items using uniform sampling without replacement.""" |
| 22 | pool = list(pool) |
| 23 | random.shuffle(pool) |
| 24 | return pool[:max_num_items] |
| 25 | |
| 26 | |
| 27 | def geometric_sample(pool: Sequence[Any], max_num_items: int, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…