Download tasks/imdb/tests/oracle-runtime/clone/backend/discovery.py from TIGER-Lab/WebsiteBench: direct link, hf CLI and curl.
- Browser
- Download file 780 Bytes
-
https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/imdb/tests/oracle-runtime/clone/backend/discovery.py
- Command line
-
hf download hf://datasets/TIGER-Lab/WebsiteBench/tasks/imdb/tests/oracle-runtime/clone/backend/discovery.py
-
curl -L -o discovery.py https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/imdb/tests/oracle-runtime/clone/backend/discovery.py
780 Bytes
| """One declarative service source for preferences, tabs, and recommendations.""" | |
| from __future__ import annotations | |
| STREAMING_SERVICES = ( | |
| {"id": "prime-video", "label": "Prime Video"}, | |
| {"id": "apple-tv-plus", "label": "Apple TV+"}, | |
| {"id": "netflix", "label": "Netflix"}, | |
| {"id": "disney-plus", "label": "Disney+"}, | |
| {"id": "hulu", "label": "Hulu"}, | |
| ) | |
| def services_for_title(title_id: str) -> tuple[str, ...]: | |
| """Return stable local availability labels without claiming live access.""" | |
| index = sum(title_id.encode("utf-8")) % len(STREAMING_SERVICES) | |
| result = [STREAMING_SERVICES[index]["id"]] | |
| if int(title_id[-1], 16) % 3 == 0: | |
| result.append(STREAMING_SERVICES[(index + 2) % len(STREAMING_SERVICES)]["id"]) | |
| return tuple(result) | |