def parse_bool(val):
    """Parse a bool value.

    Handles a series of values, but you should probably standardize on
    "true" and "false".

    >>> parse_bool('y')
    True
    >>> parse_bool('FALSE')
    False

    """
    true_vals = 't', 'true', 'yes', 'y', '1', 'on'
    false_vals = 'f', 'false', 'no', 'n', '0', 'off'
    val = val.lower()
    if val in true_vals:
        return True
    if val in false_vals:
        return False
    raise ValueError('"%s" is not a valid bool value' % val)
