def yesno_as_boolean(yesno_string):
    """converts text containing yes or no to a bool"""
    valid = {'yes': True, 'y': True, 'ye': True, 'no': False, 'n': False}
    return valid[yesno_string.lower()]
