def as_bool(self, key, default=None):
        """Return the value as a boolean. Return `default` if
        if an exception is raised while converting the value to a
        boolean.

        :param key: the name of the session attribute
        :keyword default: the value to return if the parameter is not
                          specified or an exception occurs converting
                          the value to a boolean.

        :since: 1.2
        """
        if self not in key:
            return default
        return as_bool(self[key], default)
dataset/ETHPy150Open edgewall/trac/trac/web/session.py/DetachedSession.as_bool/swapped operands of `not in`