Spaces:
Sleeping
Sleeping
Download scripted/_base.py from QuantumTransformer/CounterFeint: direct link, hf CLI and curl.
- Browser
- Download file 697 Bytes
-
https://huggingface.co/spaces/QuantumTransformer/CounterFeint/resolve/main/scripted/_base.py
- Command line
-
hf download hf://spaces/QuantumTransformer/CounterFeint/scripted/_base.py
-
curl -L -o _base.py https://huggingface.co/spaces/QuantumTransformer/CounterFeint/resolve/main/scripted/_base.py
697 Bytes
| """Shared helpers for scripted role policies.""" | |
| from __future__ import annotations | |
| from typing import Any, Dict, Protocol, runtime_checkable | |
| class Policy(Protocol): | |
| """Common callable-style interface for scripted agents. | |
| Implementations may hold light per-episode state (e.g. a round counter) | |
| but must expose `reset()` so the driver can reuse them across episodes. | |
| """ | |
| def act(self, observation: Dict[str, Any]) -> Any: ... | |
| def reset(self) -> None: ... | |
| class PolicyBase: | |
| """Mixin that gives every policy a no-op `reset()` by default.""" | |
| def reset(self) -> None: # pragma: no cover - trivial | |
| return None | |