Download solutions/format-code-task-002860.py from akseljoonas/mimo-openenv-software: direct link, hf CLI and curl.
- Browser
- Download file 513 Bytes
-
https://huggingface.co/datasets/akseljoonas/mimo-openenv-software/resolve/main/solutions/format-code-task-002860.py
- Command line
-
hf download hf://datasets/akseljoonas/mimo-openenv-software/solutions/format-code-task-002860.py
-
curl -L -o format-code-task-002860.py https://huggingface.co/datasets/akseljoonas/mimo-openenv-software/resolve/main/solutions/format-code-task-002860.py
513 Bytes
| """Reference repair for validation only; excluded from training images.""" | |
| from pathlib import Path | |
| path = Path('sqlglot/dialects/bigquery.py') | |
| text = path.read_text() | |
| text = text.replace('**parser.Parser.FUNCTIONS,', '**parser.Parser.FUNCTIONS,\n "COUNTIF": exp.CountIf.from_arg_list,', 1) | |
| marker = 'class Generator(' | |
| head, tail = text.split(marker, 1) | |
| tail = tail.replace('TRANSFORMS = {', 'TRANSFORMS = {\n exp.CountIf: rename_func("COUNTIF"),', 1) | |
| path.write_text(head + marker + tail) | |