Download modules/deap/tests/test_init.py from Johnny5b/portable-ai-runner: direct link, hf CLI and curl.
- Browser
- Download file 354 Bytes
-
https://huggingface.co/datasets/Johnny5b/portable-ai-runner/resolve/main/modules/deap/tests/test_init.py
- Command line
-
hf download hf://datasets/Johnny5b/portable-ai-runner/modules/deap/tests/test_init.py
-
curl -L -o test_init.py https://huggingface.co/datasets/Johnny5b/portable-ai-runner/resolve/main/modules/deap/tests/test_init.py
354 Bytes
| from functools import partial | |
| import random | |
| import unittest | |
| from deap import tools | |
| class LogbookTest(unittest.TestCase): | |
| def test_statistics_compile(self): | |
| length = 10 | |
| gen_idx = partial(random.sample, list(range(length)), length) | |
| i = tools.initIterate(list, gen_idx) | |
| self.assertSetEqual(set(i), set(range(length))) | |