Datasets:
Download scripts/inspect_task.py from CrossSWE/CrossSWE-Bench: direct link, hf CLI and curl.
- Browser
- Download file 954 Bytes
-
https://huggingface.co/datasets/CrossSWE/CrossSWE-Bench/resolve/main/scripts/inspect_task.py
- Command line
-
hf download hf://datasets/CrossSWE/CrossSWE-Bench/scripts/inspect_task.py
-
curl -L -o inspect_task.py https://huggingface.co/datasets/CrossSWE/CrossSWE-Bench/resolve/main/scripts/inspect_task.py
954 Bytes
| """Display a task, repositories or its evaluation specification.""" | |
| import argparse | |
| import json | |
| from common import ROOT, load_task | |
| from statement_text import read_problem_statement | |
| def main(): | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("--instance-id", required=True) | |
| parser.add_argument("--view", choices=["task", "statement", "repos", "contract"], default="task") | |
| args = parser.parse_args() | |
| task = load_task(args.instance_id) | |
| directory = ROOT / "instances" / task["instance_id"] | |
| if args.view == "statement": | |
| print(read_problem_statement(task), end="") | |
| elif args.view == "repos": | |
| print(json.dumps(task["repositories"], indent=2, ensure_ascii=False)) | |
| elif args.view == "contract": | |
| print((directory / task["evaluation"]["path"]).read_text(), end="") | |
| else: | |
| print(json.dumps(task, indent=2, ensure_ascii=False)) | |
| if __name__ == "__main__": | |
| main() | |