Download code/pocket_math/__main__.py from Palaestra/pocket-math-ops: direct link, hf CLI and curl.
- Browser
- Download file 692 Bytes
-
https://huggingface.co/datasets/Palaestra/pocket-math-ops/resolve/main/code/pocket_math/__main__.py
- Command line
-
hf download hf://datasets/Palaestra/pocket-math-ops/code/pocket_math/__main__.py
-
curl -L -o __main__.py https://huggingface.co/datasets/Palaestra/pocket-math-ops/resolve/main/code/pocket_math/__main__.py
692 Bytes
| """python -m pocket_math run ... | ops ... (see each module's help).""" | |
| from __future__ import annotations | |
| import sys | |
| def main() -> int: | |
| if len(sys.argv) < 2 or sys.argv[1] not in ("run", "ops"): | |
| print("usage: python -m pocket_math {run,ops} [args]\n run: one Kaggle session (pocket_math.runner)\n" | |
| " ops: queue and job management from a laptop (pocket_math.ops)") | |
| return 2 | |
| cmd, rest = sys.argv[1], sys.argv[2:] | |
| if cmd == "run": | |
| from .runner import main as run_main | |
| return run_main(rest) | |
| from .ops import main as ops_main | |
| return ops_main(rest) | |
| if __name__ == "__main__": | |
| sys.exit(main()) | |