Download augmentoolkit/utils/parse_bool.py from Leon4gr45/agent-0: direct link, hf CLI and curl.
- Browser
- Download file 353 Bytes
-
https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/augmentoolkit/utils/parse_bool.py
- Command line
-
hf download hf://spaces/Leon4gr45/agent-0/augmentoolkit/utils/parse_bool.py
-
curl -L -o parse_bool.py https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/augmentoolkit/utils/parse_bool.py
353 Bytes
| # created with nbconvert, minimally cleaned up | |
| def parse_bool(value): | |
| if isinstance(value, bool): | |
| return value | |
| if value.lower() in ("true", "t", "yes", "y", "1"): | |
| return True | |
| elif value.lower() in ("false", "f", "no", "n", "0"): | |
| return False | |
| else: | |
| raise ValueError(f"Cannot parse '{value}' as boolean") | |