Retrieve original value and check it wasn't signed more
        than max_age seconds ago.
323726
def unsign(self, value, max_age=None):
        
        result = super(TimestampSigner, self).unsign(value)
        value, timestamp = result.rsplit(self.sep, 1)
        timestamp = baseconv.base62.decode(timestamp)
        if max_age is not None:
            if isinstance(max_age, datetime.timedelta):
                max_age = max_age.total_seconds()
            # Check timestamp is not older than max_age
            age = time.time() - timestamp
            if age > max_age:
                raise SignatureExpired(
                    'Signature age %s > %s seconds' % (age, max_age))
        return value
1226288
def _time_to_expiry(expires):
        
        try:
            expires_dt = datetime.strptime(str(expires), '%a, %d %b %Y %H:%M:%S %Z')
            delta = expires_dt - datetime.utcnow()
            return delta.seconds
        except ValueError:
            return 0
1105742
def password_too_old?
      return false if new_record?
      return false unless password_expiration_enabled?
      return false if expire_password_on_demand?

      password_changed_at < expire_password_after.seconds.ago
    end
666589
def get_prep_value(self, value):
        ''''''
        if isinstance(value, Seconds):
            return value.seconds
        elif value:
            return self.parse_seconds(value).seconds
        else:
            return None
946497
def hasExpired(self):
        
        return (datetime.datetime.utcnow() - self.lastUpdateTime).total_seconds() > self.maxAgeSeconds
1317141
def _validate_timeout(seconds: float):
    """"""
    val = int(seconds * 1000)
    assert 60000 <= val <= 4294967294, "Bad value: {}".format(val)
    return val
327097
def _get_expiration_date(cert):
    '''
    
    '''
    cert_obj = _read_cert(cert)

    if cert_obj is None:
        raise CommandExecutionError(
            'Failed to read cert from {0}, see log for details'.format(cert)
        )

    return datetime.strptime(
        salt.utils.stringutils.to_str(cert_obj.get_notAfter()),
        four_digit_year_fmt
    )
393458
def _get_century_code(year):
        """"""
        if 2000 <= year < 3000:
            separator = 'A'
        elif 1900 <= year < 2000:
            separator = '-'
        elif 1800 <= year < 1900:
            separator = '+'
        else:
            raise ValueError('Finnish SSN do not support people born before the year 1800 or after the year 2999')
        return separator
959601
def _check_years(self, cell, prior_year):
        '''
        
        '''
        # Anything outside these values shouldn't auto
        # categorize to strings
        min_year = 1900
        max_year = 2100

        # Empty cells could represent the prior cell's title,
        # but an empty cell before we find a year is not a title
        if is_empty_cell(cell):
            return bool(prior_year)
        # Check if we have a numbered cell between min and max years
        return is_num_cell(cell) and cell > min_year and cell < max_year
1140783
def get_expiration_time(self, app: 'Quart', session: SessionMixin) -> Optional[datetime]:
        
        if session.permanent:
            return datetime.utcnow() + app.permanent_session_lifetime
        else:
            return None
713471
def expired(self):
    """"""
    expiry_time = self.expiry_time
    if expiry_time is not None:
      return expiry_time < rdfvalue.RDFDatetime.Now()
    else:
      return False
284692
def old_status(self, old_status):
        
        allowed_values = ["NEW", "DONE", "REJECTED"]
        if old_status not in allowed_values:
            raise ValueError(
                "Invalid value for `old_status` ({0}), must be one of {1}"
                .format(old_status, allowed_values)
            )

        self._old_status = old_status
306245
def detect_old(data):
    ""
    if not data:
        return False
    ok, errors, warnings = _schema.validate(_OLD_SCHEMA, data)
    return ok and not (errors or warnings)
104350
def from_mongo(cls, data, expired=False, **kw):
		""""""
		
		value = super(Expires, cls).from_mongo(data, **kw)
		
		if not expired and value.is_expired:
			return None
		
		return value
1301153
def get_age_property(value, is_bytes=False):
    """"""

    obj = unidata.ascii_age if is_bytes else unidata.unicode_age

    if value.startswith('^'):
        negated = value[1:]
        value = '^' + unidata.unicode_alias['age'].get(negated, negated)
    else:
        value = unidata.unicode_alias['age'].get(value, value)

    return obj[value]
1168795
def expires_on(self):
    """"""
    timestamp = self._info.get('expirationTime', None)
    if timestamp is None:
      return None
    return _parser.Parser.parse_timestamp(timestamp)
702260
public T getValue ()
    {
        // if the value is still around and it's expired, clear it
        if (_value != null && System.currentTimeMillis() >= _expires) {
            _value = null;
        }
        // then return the value (which may be cleared to null by now)
        return _value;
    }