Spaces:
Sleeping
Sleeping
Download example_big_project/solution/src/utils.py from DhyandevP/CodeEvaluator: direct link, hf CLI and curl.
- Browser
- Download file 568 Bytes
-
https://huggingface.co/spaces/DhyandevP/CodeEvaluator/resolve/main/example_big_project/solution/src/utils.py
- Command line
-
hf download hf://spaces/DhyandevP/CodeEvaluator/example_big_project/solution/src/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/DhyandevP/CodeEvaluator/resolve/main/example_big_project/solution/src/utils.py
568 Bytes
| import uuid | |
| # In-memory storage for tasks | |
| tasks_db = {} | |
| def create_task(title, description=""): | |
| task_id = str(uuid.uuid4()) | |
| task = { | |
| "id": task_id, | |
| "title": title, | |
| "description": description, | |
| "completed": False | |
| } | |
| tasks_db[task_id] = task | |
| return task | |
| def get_all_tasks(): | |
| return list(tasks_db.values()) | |
| def get_task_by_id(task_id): | |
| return tasks_db.get(task_id) | |
| def complete_task(task_id): | |
| task = tasks_db.get(task_id) | |
| if task: | |
| task["completed"] = True | |
| return task | |
| return None | |