def make_bool(token_string):
    """
    Converts a token string to a boolean.
    """
    if token_string in ('yes', 'true'): return True
    elif token_string in ('no', 'false'): return False
    else: raise ValueError('Invalid token string %s for bool.' % token_string)