Spaces:
Sleeping
Sleeping
Download dataset/problem_12/buggy.py from Viraj0112/rl_code_fix_env: direct link, hf CLI and curl.
- Browser
- Download file 350 Bytes
-
https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_12/buggy.py
- Command line
-
hf download hf://spaces/Viraj0112/rl_code_fix_env/dataset/problem_12/buggy.py
-
curl -L -o buggy.py https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_12/buggy.py
350 Bytes
| def parse_pairs(raw: str) -> dict[str, int]: | |
| """Parse strings like 'a=1,b=2' into a dict.""" | |
| result = {} | |
| if not raw: | |
| return result | |
| for segment in raw.split(","): | |
| key, value = segment.split("=") | |
| # BUG: does not strip whitespace around keys/values. | |
| result[key] = int(value) | |
| return result | |