Download src/tasks/easy.py from Jivan01/agentBox: direct link, hf CLI and curl.
- Browser
- Download file 548 Bytes
-
https://huggingface.co/spaces/Jivan01/agentBox/resolve/main/src/tasks/easy.py
- Command line
-
hf download hf://spaces/Jivan01/agentBox/src/tasks/easy.py
-
curl -L -o easy.py https://huggingface.co/spaces/Jivan01/agentBox/resolve/main/src/tasks/easy.py
548 Bytes
| from typing import Dict | |
| import ast | |
| MIN_TASK_SCORE = 0.01 | |
| MAX_TASK_SCORE = 0.99 | |
| def get_task() -> Dict: | |
| return { | |
| "id": "easy", | |
| "difficulty": "easy", | |
| "name": "lint_fix", | |
| "objective": "Fix syntax errors so the candidate code parses successfully.", | |
| "description": "Fix syntax errors in the given Python code.", | |
| "grader_name": "grade", | |
| "score_range": [MIN_TASK_SCORE, MAX_TASK_SCORE], | |
| } | |
| def grade(candidate_code: str) -> float: | |
| try: | |
| ast.parse(candidate_code) | |
| return MAX_TASK_SCORE | |
| except SyntaxError: | |
| return MIN_TASK_SCORE | |