Gets the outstanding evaluators that have not yet reported back and mark them as expired.
778763
private Set<String> getOutstandingEvaluatorsAndMarkExpired() {
    final Set<String> outstanding = new HashSet<>();
    for (final String previousEvaluatorId : restartEvaluators.getEvaluatorIds()) {
      if (getStateOfPreviousEvaluator(previousEvaluatorId) == EvaluatorRestartState.EXPECTED) {
        outstanding.add(previousEvaluatorId);
        setEvaluatorExpired(previousEvaluatorId);
      }
    }

    return outstanding;
  }
1163715
public synchronized List<FailedContext> getFailedContextsForEvaluatorFailure() {
    final List<FailedContext> failedContextList = new ArrayList<>();
    final List<EvaluatorContext> activeContexts = new ArrayList<>(this.contextStack);
    Collections.reverse(activeContexts);

    for (final EvaluatorContext context : activeContexts) {
      failedContextList.add(context.getFailedContextForEvaluatorFailure());
    }
    return failedContextList;
  }
11854
private void ensureExpiration() {

        boolean expirationDateSet = false;
        boolean releaseDateSet = false;
        if (getFilterQueries() != null) {
            for (String fq : getFilterQueries()) {
                if (fq.startsWith(CmsSearchField.FIELD_DATE_EXPIRED + ":")) {
                    expirationDateSet = true;
                }
                if (fq.startsWith(CmsSearchField.FIELD_DATE_RELEASED + ":")) {
                    releaseDateSet = true;
                }
            }
        }
        if (!expirationDateSet) {
            addFilterQuery(CmsSearchField.FIELD_DATE_EXPIRED + ":[NOW TO *]");
        }
        if (!releaseDateSet) {
            addFilterQuery(CmsSearchField.FIELD_DATE_RELEASED + ":[* TO NOW]");
        }
    }
528128
protected List<Object> getObjects(final Evaluator _evaluator)
        throws EFapsException
    {
        final List<Object> result;
        if (_evaluator == null) {
            result = this.objects;
        } else {
            result = new ArrayList<>();
            final AbstractElement<?> element = getElements().get(getElements().size() - 1);
            final String path = element.getPath();
            final Select instSelection = _evaluator.getSelection().getInstSelects().get(StringUtils.isEmpty(path)
                            ? Selection.BASEPATH
                            : path);
            final List<Object> instObjs = instSelection.getObjects(null);
            final Iterator<Object> objIter = this.objects.iterator();
            for (final Object instObj : instObjs) {
                if (_evaluator.getAccess().hasAccess((Instance) instObj)) {
                    result.add(objIter.next());
                } else {
                    objIter.next();
                }
            }
        }
        return Collections.unmodifiableList(result);
    }
3850
void runCheckAsync(final EvaluatorManager manager) {

    final String evaluatorId = manager.getId();
    LOG.log(Level.FINEST, "Idle check for Evaluator: {0}", manager);

    this.executor.submit(new Runnable() {

      @Override
      public void run() {

        LOG.log(Level.FINEST, "Idle check for Evaluator {0} - begin", evaluatorId);

        while (!manager.isClosed()) {
          try {

            LOG.log(Level.FINEST,
                "Waiting for Evaluator {0} to close: Sleep for {1} ms",
                new Object[] {evaluatorId, waitInMillis});

            Thread.sleep(waitInMillis);

          } catch (final InterruptedException e) {
            LOG.log(Level.SEVERE, "Thread interrupted while waiting for Evaluator to finish.");
            throw new RuntimeException(e);
          }
        }

        manager.checkIdlenessSource();

        LOG.log(Level.FINEST, "Idle check for Evaluator {0} - end", evaluatorId);
      }

      @Override
      public String toString() {
        return "CheckIdle: " + evaluatorId;
      }
    });
  }
853341
def getExpirations(self, contract_identifier, expired=0):
        
        expirations = []
        contracts = self.contractDetails(contract_identifier)["contracts"]

        if contracts[0].m_secType not in ("FUT", "FOP", "OPT"):
            return []

        # collect expirations
        for contract in contracts:
            expirations.append(contract.m_expiry)

        # convert to ints
        expirations = list(map(int, expirations))
        # expirations = list(set(expirations))

        # remove expired contracts
        today = int(datetime.now().strftime("%Y%m%d"))
        closest = min(expirations, key=lambda x: abs(x - today))
        expirations = expirations[expirations.index(closest) - expired:]

        return tuple(expirations)
1316889
protected void doChecks(CacheItem item, List<CacheItem> itemsToRefresh) {
        boolean expired;
        boolean willBeRefreshed;

        try {
            expired = checkForExpiration(item);
            if (expired) {
                if (logger.isDebugEnabled()) {
                    logger.debug(item + " was removed because it expired");
                }
            } else {
                willBeRefreshed = checkForRefresh(item, itemsToRefresh);
                if (willBeRefreshed) {
                    if (logger.isDebugEnabled()) {
                        logger.debug(item + " will be refreshed");
                    }
                }
            }
        } catch (Exception ex) {
            logger.warn("Exception while checking " + item + " for expiration/refresh", ex);
        }
    }
1284529
function validateExpires(req, expires) {
	if(!expires) {
		return false;
	}
	if(Date.now() - (expires * 1000) > 0) {
		clearAllPersistentData(req);
		return false;
	}
	return true;
}
484145
def CheckBreakpointsExpiration(self):
    """"""
    with self._lock:
      current_time = BreakpointsManager.GetCurrentTime()
      if self._next_expiration > current_time:
        return

      expired_breakpoints = []
      self._next_expiration = datetime.max
      for breakpoint in six.itervalues(self._active):
        expiration_time = breakpoint.GetExpirationTime()
        if expiration_time <= current_time:
          expired_breakpoints.append(breakpoint)
        else:
          self._next_expiration = min(self._next_expiration, expiration_time)

    for breakpoint in expired_breakpoints:
      breakpoint.ExpireBreakpoint()
400409
def delete_expired_users(self):
        
        deleted_users = []
        for user in get_user_model().objects.filter(is_staff=False,
                                                    is_active=False):
            if user.userena_signup.activation_key_expired():
                deleted_users.append(user)
                user.delete()
        return deleted_users
1050779
def get_validators(self):
        
        # If the validators have been declared explicitly then use that.
        validators = getattr(getattr(self, 'Meta', None), 'validators', None)
        if validators is not None:
            return validators[:]

        # Otherwise use the default set of validators.
        return (
            self.get_unique_together_validators() +
            self.get_unique_for_date_validators()
        )
611261
protected void removeExpiredMeters() {
    int total = 0;
    int expired = 0;
    Iterator<Map.Entry<Id, Meter>> it = meters.entrySet().iterator();
    while (it.hasNext()) {
      ++total;
      Map.Entry<Id, Meter> entry = it.next();
      Meter m = entry.getValue();
      if (m.hasExpired()) {
        ++expired;
        it.remove();
      }
    }
    logger.debug("removed {} expired meters out of {} total", expired, total);
    cleanupCachedState();
  }
1306156
private void checkJwtClaims(JwtClaims jwtClaims) {
    Optional<NumericDate> expiration = getDateClaim(ReservedClaimNames.EXPIRATION_TIME, jwtClaims);
    if (!expiration.isPresent()) {
      throw new UnauthenticatedException("Missing expiration field");
    }
    Optional<NumericDate> notBefore = getDateClaim(ReservedClaimNames.NOT_BEFORE, jwtClaims);

    NumericDate currentTime = NumericDate.fromMilliseconds(clock.currentTimeMillis());
    if (expiration.get().isBefore(currentTime)) {
      throw new UnauthenticatedException("The auth token has already expired");
    }

    if (notBefore.isPresent() && notBefore.get().isAfter(currentTime)) {
      String message = "Current time is earlier than the \"nbf\" time";
      throw new UnauthenticatedException(message);
    }
  }
102661
@Override
    public Set<String> doGetExpired(final Set<String> candidates) {
        final long now = System.currentTimeMillis();
        Set<String> expired = new HashSet<>();

        // iterate over the files and work out which have expired
        for (String filename : sessionFileMap.values()) {
            try {
                long expiry = getExpiryFromFilename(filename);
                if (expiry > 0 && expiry < now) {
                    expired.add(getIdFromFilename(filename));
                }
            } catch (Exception e) {
                log.warn(e.getMessage(), e);
            }
        }

        // check candidates that were not found to be expired, perhaps
        // because they no longer exist and they should be expired
        for (String c : candidates) {
            if (!expired.contains(c)) {
                // if it doesn't have a file then the session doesn't exist
                String filename = sessionFileMap.get(c);
                if (filename == null) {
                    expired.add(c);
                }
            }
        }

        // Infrequently iterate over all files in the store, and delete those
        // that expired a long time ago.
        // If the graceperiod is disabled, don't do the sweep!
        if (gracePeriodSec > 0 &&
                (lastSweepTime == 0L ||
                        ((now - lastSweepTime) >= (5 * TimeUnit.SECONDS.toMillis(gracePeriodSec))))) {
            lastSweepTime = now;
            sweepDisk();
        }
        return expired;
    }
148625
private List<com.baidu.unbiz.fluentvalidator.Validator> getAddOnValidators(FluentValid fluentValid) {
        Class<? extends com.baidu.unbiz.fluentvalidator.Validator>[] addOnValidatorClasses;
        List<com.baidu.unbiz.fluentvalidator.Validator> addOnValidators = null;
        if (!ArrayUtil.isEmpty(fluentValid.value())) {
            LOGGER.debug(String.format("{} additional validators found"), fluentValid.value().length);
            addOnValidatorClasses = fluentValid.value();
            addOnValidators = CollectionUtil.createArrayList(fluentValid.value().length);
            for (Class<? extends com.baidu.unbiz.fluentvalidator.Validator> addOnValidatorClass :
                    addOnValidatorClasses) {
                List<?> beans = registry.findByType(addOnValidatorClass);
                if (!CollectionUtil.isEmpty(beans)) {
                    addOnValidators.add((com.baidu.unbiz.fluentvalidator.Validator) beans.get(0));
                }
            }
        }
        return addOnValidators;
    }
1365981
public synchronized boolean onRecoverEvaluator(final String evaluatorId) {
    if (getStateOfPreviousEvaluator(evaluatorId).isFailedOrNotExpected()) {
      final String errMsg = "Evaluator with evaluator ID " + evaluatorId + " not expected to be alive.";
      LOG.log(Level.SEVERE, errMsg);
      throw new DriverFatalRuntimeException(errMsg);
    }

    if (getStateOfPreviousEvaluator(evaluatorId) != EvaluatorRestartState.EXPECTED) {
      LOG.log(Level.WARNING, "Evaluator with evaluator ID " + evaluatorId + " added to the set" +
          " of recovered evaluators more than once. Ignoring second add...");
      return false;
    }

    // set the status for this evaluator ID to be reported.
    setEvaluatorReported(evaluatorId);

    if (haveAllExpectedEvaluatorsReported()) {
      onDriverRestartCompleted(false);
    }

    return true;
  }
769948
def delete_expired_users(self):
        
        deleted_users = []
        for user in self.filter(is_staff=False, is_active=False):
            if user.activation_key_expired():
                deleted_users.append(user)
                user.delete()
        return deleted_users