Download fixtures/seed_project/jobqueue.py from tailot/lingologos-thinkingpython: direct link, hf CLI and curl.
- Browser
- Download file 325 Bytes
-
https://huggingface.co/datasets/tailot/lingologos-thinkingpython/resolve/main/fixtures/seed_project/jobqueue.py
- Command line
-
hf download hf://datasets/tailot/lingologos-thinkingpython/fixtures/seed_project/jobqueue.py
-
curl -L -o jobqueue.py https://huggingface.co/datasets/tailot/lingologos-thinkingpython/resolve/main/fixtures/seed_project/jobqueue.py
325 Bytes
| import heapq | |
| import os | |
| def drain(jobs=[]): | |
| names = [] | |
| for job in jobs: | |
| names.append(job['id']) | |
| return names | |
| def retry(seconds: int): | |
| return seconds + 30 | |
| def head(task): | |
| if task.get('queued'): | |
| return task['id'] | |
| return None | |
| def line(task): | |
| return task['id'] + ' @ ' + task['at'] | |