def str_to_bool(b_str):
    """ returns True  if b_str is '1', 't', 'true', 'y' or 'yes' (case insensitive)
                False if b_str is '0', 'f', 'false', 'n' or 'no' (case insensitive)
        raise ValueError exception in other cases
    """
    b_str = b_str.lower()
    if b_str in ('t', 'true', '1', 'y', 'yes'):
        return True
    if b_str in ('f', 'false', '0', 'n', 'no'):
        return False
    raise ValueError("invalid boolean litteral '%s'" % (b_str,))
