from typing import Any, Iterable, Iterator


def cycle(base: Iterable[Any]) -> Iterator[Any]:
    iterator = iter(base)
    while True:
        try:
            yield next(iterator)
        except StopIteration:
            iterator = iter(base)
            


def require(condition: bool, error: Exception = ValueError, message: str = "") -> None:
    if not condition:
        raise error(message)
