Shuffle list x in place, and return None.
(self, x)
| 354 | return seq[self._randbelow(len(seq))] |
| 355 | |
| 356 | def shuffle(self, x): |
| 357 | """Shuffle list x in place, and return None.""" |
| 358 | |
| 359 | randbelow = self._randbelow |
| 360 | for i in reversed(range(1, len(x))): |
| 361 | # pick an element in x[:i+1] with which to exchange x[i] |
| 362 | j = randbelow(i + 1) |
| 363 | x[i], x[j] = x[j], x[i] |
| 364 | |
| 365 | def sample(self, population, k, *, counts=None): |
| 366 | """Chooses k unique random elements from a population sequence. |