def booleanize(value):
    """
    Convert a string to a boolean.

    :raises: ValueError if unable to convert.

    :param str value: String to convert.

    :return: True if value in lowercase matches "true" or "yes"; False if value
     in lowercase matches "false"or "no".
    :rtype: bool
    """
    valuemap = {'true': True, 'yes': True, 'false': False, 'no': False}
    casted = valuemap.get(value.lower(), None)
    if casted is None:
        raise ValueError(str(value))
    return casted
