Spaces:
Sleeping
Sleeping
Download dataset/problem_5/buggy.py from Viraj0112/rl_code_fix_env: direct link, hf CLI and curl.
- Browser
- Download file 362 Bytes
-
https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_5/buggy.py
- Command line
-
hf download hf://spaces/Viraj0112/rl_code_fix_env/dataset/problem_5/buggy.py
-
curl -L -o buggy.py https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_5/buggy.py
362 Bytes
| def chunk_list(items: list[int], size: int) -> list[list[int]]: | |
| """Split a list into chunks of a fixed size.""" | |
| if size <= 0: | |
| raise ValueError("size must be positive") | |
| chunks = [] | |
| # BUG: drops the final partial chunk. | |
| for i in range(0, len(items) - size, size): | |
| chunks.append(items[i : i + size]) | |
| return chunks | |