Return true if the auth is not expired, else false
344660
def is_auth_alive(self):
        ""
        model = self.model('ir.model')
        try:
            model.search([], None, 1, None)
        except ClientError as err:
            if err and err.message['code'] == 403:
                return False
            raise
        except Exception:
            raise
        else:
            return True
276709
public function isExpired()
    {
        if ($this->getExpiresAt() instanceof \DateTime) {
            return $this->getExpiresAt()->getTimestamp() < time();
        }

        if ($this->isAppAccessToken()) {
            return false;
        }

        return null;
    }
573740
def _has_valid_token(self):
        
        return bool(self.token and (self.expires > datetime.datetime.now()))
645889
public function isAccessTokenExpired()
  {
    if (!$this->token || !isset($this->token['created'])) {
      return true;
    }

    // If the token is set to expire in the next 30 seconds.
    $expired = ($this->token['created']
        + ($this->token['expires_in'] - 30)) < time();

    return $expired;
  }
1313725
function is_expired()
    {
        $now = time();

        foreach ($this->subkeys as $subkey)
            if (!$subkey->expires || $subkey->expires > $now)
                return true;

        return false;
    }
573609
def _is_expired_response(self, response):
        
        if response.status_code != 401:
            return False
        challenge = response.headers.get('www-authenticate', '')
        return 'error="invalid_token"' in challenge
67253
def is_expired(self):
        
        expires_at = self.expires_at
        if expires_at is not None and expires_at != self.created:
            return expires_at < datetime.utcnow()

        return False
604464
def is_expired_token(self, client):
        
        if 'expires' not in client:
            return True

        expires = dateutil.parser.parse(client['expires'])
        if expires < datetime.datetime.now():
            return True

        return False
625870
public boolean hasExpired() {
        if (maxAge == 0) return true;

        // if not specify max-age, this cookie should be
        // discarded when user agent is to be closed, but
        // it is not expired.
        if (maxAge == MAX_AGE_UNSPECIFIED) return false;

        long deltaSecond = (System.currentTimeMillis() - whenCreated) / 1000;
        if (deltaSecond > maxAge)
            return true;
        else
            return false;
    }
738559
def expired(self):
        
        if self.timeout is None:
            return False

        return monotonic() - self.start_time > self.timeout
1299256
def has_requests(self, auth):
        """"""
        authstr = self._authstr(auth)
        return (authstr in self._requests
                and len(self._requests[authstr]) > 0)
467628
def check_auth(self, username, password):
        '''  '''
        return username == self.queryname and password == self.querypw
746930
function isLoggedInMiddleware() {
		return function isLoggedIn(req, res, next) {
			const AclUser = mongoose.model("TransomAclUser");

			if ((req.headers && req.headers.authorization) || (req.body && req.body.access_token) || (req.query && req.query.access_token)) {
				// Verify the authorization token or fail.
				passport.authenticate('bearer', {
					session: false
				}, function (err, user, info) {
					if (err) {
						return next(err);
					}
					if (!user || (info && info.indexOf("invalid_token") >= 0)) {
						// Something didn't work out.  Token Expired / Denied.
						debug("NOT LoggedIn - Invalid");
						return next(new restifyErrors.InvalidCredentialsError("Incorrect or expired credentials"));
					} else {
						// Properly authenticated!
						return next();
					}
				})(req, res, next);
			} else {
				// debug("No Authorization header or query access_token. Trying Anonymous.");
				if (localuser.anonymous !== false) {
					// Attempt anonymous login, if possible;
					AclUser.findOne({
						'username': 'anonymous',
						'active': true
					}, function (err, user) {
						if (err) {
							return next(err);
						}
						if (user) {
							req.locals = req.locals || {};
							req.locals.user = user;
							return next();
						}
						// Oh no, not authenticated
						debug("No bearer token provided or query access_token. No Anonymous user available.");
						return next(new restifyErrors.InvalidCredentialsError("No bearer token provided or query access_token. No Anonymous user available."));
					});
				} else {
					debug("No bearer token provided or query access_token.");
					return next(new restifyErrors.InvalidCredentialsError("No bearer token provided or query access_token."));
				}
			}
		}
	}
313114
def check_auth(email, password):
    
    try:
        user = User.get(User.email == email)
    except User.DoesNotExist:
        return False
    return password == user.password
1178384
def expired?
      return false if @task.expires_after.blank?

      expire_duration.from_now(@scheduled_time) < Time.now.in_time_zone(@task.time_zone)
    end
350406
def is_expired(self):
        '''
        
        '''
        if self.window is not None:
            return (self._time() - self.start_time) >= self.window
        return False
1089678
protected boolean isExpired(OAuthProviderTokenImpl authToken) {
    if (authToken.isAccessToken()) {
      if ((authToken.getTimestamp() + (getAccessTokenValiditySeconds() * 1000L)) < System.currentTimeMillis()) {
        return true;
      }
    }
    else {
      if ((authToken.getTimestamp() + (getRequestTokenValiditySeconds() * 1000L)) < System.currentTimeMillis()) {
        return true;
      }
    }

    return false;
  }