def as_int(self, key, default=None, min=None, max=None):
        """Return the value as an integer. Return `default` if
        if an exception is raised while converting the value to an
        integer.

        :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 an integer.
        :keyword min: lower bound to which the value is limited
        :keyword max: upper bound to which the value is limited

        :since: 1.2
        """
        if key not in self:
            return default
        return as_int(self[key], default, min, max)
dataset/ETHPy150Open edgewall/trac/trac/web/session.py/DetachedSession.as_int/original