Datasets:
Tasks:
Text Generation
Formats:
parquet
Sub-tasks:
language-modeling
Languages:
English
Size:
< 1K
License:
Download harbor/tasks/ahooks_request_cache_races/environment/capture.py from ExpertCrowd/ec-swe: direct link, hf CLI and curl.
- Browser
- Download file 794 Bytes
-
https://huggingface.co/datasets/ExpertCrowd/ec-swe/resolve/main/harbor/tasks/ahooks_request_cache_races/environment/capture.py
- Command line
-
hf download hf://datasets/ExpertCrowd/ec-swe/harbor/tasks/ahooks_request_cache_races/environment/capture.py
-
curl -L -o capture.py https://huggingface.co/datasets/ExpertCrowd/ec-swe/resolve/main/harbor/tasks/ahooks_request_cache_races/environment/capture.py
794 Bytes
| """Capture a patch against protected baseline history inside the agent sandbox.""" | |
| import json | |
| import os | |
| import shutil | |
| import sys | |
| import tempfile | |
| from pathlib import Path | |
| sys.path.insert(0, "/opt/task-tools") | |
| from capture_submission import capture_submission # noqa: E402 | |
| with tempfile.TemporaryDirectory(prefix="capture-") as directory: | |
| git_dir = Path(directory) / "git" | |
| shutil.copytree("/opt/task-tools/baseline.git", git_dir) | |
| os.environ.update( | |
| GIT_DIR=str(git_dir), | |
| GIT_WORK_TREE="/workspace/repo", | |
| GIT_CONFIG_NOSYSTEM="1", | |
| GIT_CONFIG_GLOBAL="/dev/null", | |
| ) | |
| print( | |
| json.dumps( | |
| capture_submission( | |
| Path("/workspace/repo"), Path("/workspace/submissions/submitted.patch") | |
| ) | |
| ) | |
| ) | |