from typing import Union


def bool_value(s: Union[str, int]) -> bool:
    """
    Convert a string or int to a boolean value. Raises ValueError if the string
    isn't boolean.

    :param s: the string

    :return: the boolean
    """
    if isinstance(s, bool):
        return s

    if isinstance(s, int):
        return False if s == 0 else True

    sl = s.lower()
    if sl in ('t', 'true', '1', 'yes'):
        return True
    elif sl in ('f', 'false', '0', 'no'):
        return False
    else:
        raise ValueError(f'Bad boolean value: "{s}"')