from __future__ import annotations import random from typing import Any, Protocol, Sequence class Rng(Protocol): def random(self) -> float: ... def choices( self, population: Sequence[Any], weights: Sequence[float] | None = None, *, k: int = 1, ) -> list[Any]: ... def system_rng() -> random.SystemRandom: return random.SystemRandom() def seeded_rng(seed: int | str | bytes | bytearray) -> random.Random: return random.Random(seed)