def str_to_bool(s):
    """
    Converts the given string into a boolean.

    Values resulting in True:
    - a string representing an integer != 0
    - the string 'true' ignoring upper/lower case
    - the string 'y' or 'yes' ignoring upper/lower case

    Other values will result in False as return value.

    :param s: The string to convert
    :type s: str
    :return: A boolean value
    :rtype: bool
    """
    if isinstance(s, bool):
        return s
    if not isinstance(s, str):
        return False
    if s.lower() in ('true', 'yes', 'y'):
        return True
    try:
        i = int(s)
        if i != 0:
            return True
    except ValueError:
        pass
    return False
