(self, seq)
| 395 | # NOTE: the numpy implementations of `choice` don't support strings, so |
| 396 | # this cannot be replaced with self._rng.choice |
| 397 | def choice(self, seq): |
| 398 | import numpy as np |
| 399 | |
| 400 | if isinstance(self._rng, np.random.Generator): |
| 401 | idx = self._rng.integers(0, len(seq)) |
| 402 | else: |
| 403 | idx = self._rng.randint(0, len(seq)) |
| 404 | return seq[idx] |
| 405 | |
| 406 | def gauss(self, mu, sigma): |
| 407 | return self._rng.normal(mu, sigma) |