| 190 | |
| 191 | |
| 192 | class _bootstrap_internal: |
| 193 | def __init__(self, f, n): |
| 194 | self.f = f |
| 195 | self.n = n |
| 196 | |
| 197 | def __call__(self, v): |
| 198 | i, xs = v |
| 199 | rnd = random.Random() |
| 200 | rnd.seed(i) |
| 201 | res = [] |
| 202 | for _ in range(self.n): |
| 203 | res.append(self.f(rnd.choices(xs, k=len(xs)))) |
| 204 | return res |
| 205 | |
| 206 | |
| 207 | def bootstrap_stderr(f, xs, iters): |