def cast_bool(value: str) -> bool:
    value = value.lower()

    if value in ("1", "true", "yes", "on"):
        return True

    if value in ("0", "false", "no", "off"):
        return False

    raise ValueError(f"Cannot cast '{value}' to bool")