def parse_state(state):
    """Convert a bool, or string, into a bool.

    The string pairs we respond to (case insensitively) are:
    
    - ALLOW & DENY
    - GRANT & REJECT

    :returns bool: ``True`` or ``False``.
    :raises ValueError: when not a ``bool`` or one of the above strings.

    E.g.::

        >>> parse_state('Allow')
        True

    """
    if isinstance(state, bool):
        return state
    if not isinstance(state, basestring):
        raise TypeError('ACL state must be bool or string')
    try:
        return _state_strings[state.lower()]
    except __HOLE__:
        raise ValueError('unknown ACL state string')
dataset/ETHPy150Open mikeboers/Flask-ACL/flask_acl/state.py/parse_state