from typing import Union


def parse_bool(bool_string: Union[str, bool]) -> bool:
    """
    Parse a boolean from a string.
    """
    # Be strict here to remove complexity of options (but allow already parsed).
    if bool_string in ("True", True):
        return True
    if bool_string in ("False", False):
        return False
    raise ValueError(f"invalid boolean: {str(bool_string)}")