Download 113/solution/_reference.py from PRHW/loom-benchmark-mbpp: direct link, hf CLI and curl.
- Browser
- Download file 328 Bytes
-
https://huggingface.co/datasets/PRHW/loom-benchmark-mbpp/resolve/main/113/solution/_reference.py
- Command line
-
hf download hf://datasets/PRHW/loom-benchmark-mbpp/113/solution/_reference.py
-
curl -L -o _reference.py https://huggingface.co/datasets/PRHW/loom-benchmark-mbpp/resolve/main/113/solution/_reference.py
328 Bytes
| def check_integer(text): | |
| text = text.strip() | |
| if len(text) < 1: | |
| return None | |
| else: | |
| if all(text[i] in "0123456789" for i in range(len(text))): | |
| return True | |
| elif (text[0] in "+-") and \ | |
| all(text[i] in "0123456789" for i in range(1,len(text))): | |
| return True | |
| else: | |
| return False |