Download server/going_concern/firms.py from KayamAI/corner-shop: direct link, hf CLI and curl.
- Browser
- Download file 446 Bytes
-
https://huggingface.co/datasets/KayamAI/corner-shop/resolve/main/server/going_concern/firms.py
- Command line
-
hf download hf://datasets/KayamAI/corner-shop/server/going_concern/firms.py
-
curl -L -o firms.py https://huggingface.co/datasets/KayamAI/corner-shop/resolve/main/server/going_concern/firms.py
446 Bytes
| """Selection of the public Corner Shop firms.""" | |
| PUBLIC_FIRMS = range(1, 101) | |
| def firm_from_seed(seed: int) -> int: | |
| return PUBLIC_FIRMS[seed % len(PUBLIC_FIRMS)] | |
| def task_firms(firms: list[int] | None, seed: int | None) -> list[int]: | |
| """Keep an explicit task list (including an empty one), or select by seed.""" | |
| if firms is not None: | |
| return firms | |
| return list(PUBLIC_FIRMS) if seed is None else [firm_from_seed(seed)] | |