Datasets:
Download code/math_code_010_verify.py from efe-T/bilingual-math-code-verification-v1: direct link, hf CLI and curl.
- Browser
- Download file 615 Bytes
-
https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_010_verify.py
- Command line
-
hf download hf://datasets/efe-T/bilingual-math-code-verification-v1/code/math_code_010_verify.py
-
curl -L -o math_code_010_verify.py https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_010_verify.py
615 Bytes
| from fractions import Fraction | |
| defective, nondefective = 20000, 980000 | |
| one_defective = defective * 95 // 100 | |
| one_nondefective = nondefective * 10 // 100 | |
| two_defective = one_defective * 95 // 100 | |
| two_nondefective = one_nondefective * 10 // 100 | |
| assert (one_defective, one_nondefective) == (19000, 98000) | |
| assert (two_defective, two_nondefective) == (18050, 9800) | |
| result = {"one_positive": str(Fraction(one_defective, one_defective + one_nondefective)), | |
| "two_positives": str(Fraction(two_defective, two_defective + two_nondefective))} | |
| import json | |
| print(json.dumps(result, ensure_ascii=False, sort_keys=True)) | |