Download stackgo/tests/test_repoinfo_hoeffding.py from s0duku/the-stack-go: direct link, hf CLI and curl.
- Browser
- Download file 745 Bytes
-
https://huggingface.co/datasets/s0duku/the-stack-go/resolve/main/stackgo/tests/test_repoinfo_hoeffding.py
- Command line
-
hf download hf://datasets/s0duku/the-stack-go/stackgo/tests/test_repoinfo_hoeffding.py
-
curl -L -o test_repoinfo_hoeffding.py https://huggingface.co/datasets/s0duku/the-stack-go/resolve/main/stackgo/tests/test_repoinfo_hoeffding.py
745 Bytes
| import math | |
| from tests.audit_repoinfo_hoeffding import hoeffding_radius, required_sample_size | |
| def test_hoeffding_sample_size_for_90_90(): | |
| assert required_sample_size(0.90, 0.10) == 150 | |
| assert hoeffding_radius(150, 0.90) <= 0.10 | |
| def test_perfect_sample_proves_90_percent_lower_bound(): | |
| lower_bound = 1.0 - hoeffding_radius(150, 0.90) | |
| assert lower_bound >= 0.90 | |
| assert math.isclose(lower_bound, 0.9000711540886218) | |
| def test_hoeffding_arguments_are_validated(): | |
| for confidence, margin in ((0.0, 0.1), (1.0, 0.1), (0.9, 0.0), (0.9, 1.0)): | |
| try: | |
| required_sample_size(confidence, margin) | |
| except ValueError: | |
| pass | |
| else: | |
| raise AssertionError((confidence, margin)) | |