Spaces:
Paused
Paused
Download changedetectionio/strtobool.py from minhpn/changedetection: direct link, hf CLI and curl.
- Browser
- Download file 434 Bytes
-
https://huggingface.co/spaces/minhpn/changedetection/resolve/main/changedetectionio/strtobool.py
- Command line
-
hf download hf://spaces/minhpn/changedetection/changedetectionio/strtobool.py
-
curl -L -o strtobool.py https://huggingface.co/spaces/minhpn/changedetection/resolve/main/changedetectionio/strtobool.py
434 Bytes
| # Because strtobool was removed in python 3.12 distutils | |
| _MAP = { | |
| 'y': True, | |
| 'yes': True, | |
| 't': True, | |
| 'true': True, | |
| 'on': True, | |
| '1': True, | |
| 'n': False, | |
| 'no': False, | |
| 'f': False, | |
| 'false': False, | |
| 'off': False, | |
| '0': False | |
| } | |
| def strtobool(value): | |
| try: | |
| return _MAP[str(value).lower()] | |
| except KeyError: | |
| raise ValueError('"{}" is not a valid bool value'.format(value)) | |