def parse_bool(data):
    """Parse a string value to bool"""
    if data.lower() in ('yes', 'true',):
        return True
    elif data.lower() in ('no', 'false',):
        return False
    else:
        err = f'"{data}" could not be interpreted as a boolean'
        raise TypeError(err)