Spaces:
Sleeping
Sleeping
Download dataset/problem_8/buggy.py from Viraj0112/rl_code_fix_env: direct link, hf CLI and curl.
- Browser
- Download file 354 Bytes
-
https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_8/buggy.py
- Command line
-
hf download hf://spaces/Viraj0112/rl_code_fix_env/dataset/problem_8/buggy.py
-
curl -L -o buggy.py https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_8/buggy.py
354 Bytes
| def flatten_one_level(items: list) -> list: | |
| """Flatten only one nesting level.""" | |
| result = [] | |
| for item in items: | |
| # BUG: recursively flattens all levels instead of one level. | |
| if isinstance(item, list): | |
| result.extend(flatten_one_level(item)) | |
| else: | |
| result.append(item) | |
| return result | |