Test whether the stopping criteria has been achieved.
518566
def stopping_criteria(self):
        ""
        if self.stopping_criteria_tl():
            return True
        if self.generations < np.inf:
            inds = self.popsize * self.generations
            flag = inds <= len(self.population.hist)
        else:
            flag = False
        if flag:
            return True
        est = self.population.estopping
        if self._tr_fraction < 1:
            if est is not None and est.fitness_vs == 0:
                return True
        esr = self._early_stopping_rounds
        if self._tr_fraction < 1 and esr is not None and est is not None:
            position = self.population.estopping.position
            if position < self.init_popsize:
                position = self.init_popsize
            return (len(self.population.hist) +
                    self._unfeasible_counter -
                    position) > esr
        return flag
1102534
def isDone(self):
        """"""
        done = pydaq.bool32()
        self.IsTaskDone(ctypes.byref(done))
        return done.value
718078
def is_success(self):
        '''   '''
        for _session in self._sessions.values():
            if not _session.is_success():
                return False
        return True
1108791
def success(self, msg, *args, **kw):
        """"""
        if self.isEnabledFor(SUCCESS):
            self._log(SUCCESS, msg, args, **kw)
509675
def _check_fulfilled(self):
        
        is_fulfilled = False
        result = None
        start_time = time.time()

        # Check whether the promise has been fulfilled until we run out of time or attempts
        while self._has_time_left(start_time) and self._has_more_tries():

            # Keep track of how many attempts we've made so far
            self._num_tries += 1

            is_fulfilled, result = self._check_func()

            # If the promise is satisfied, then continue execution
            if is_fulfilled:
                break

            # Delay between checks
            time.sleep(self._try_interval)

        return is_fulfilled, result
809041
def successful(self):
        """"""
        for result in self.results:
            if result.code == ResultCode.FAILED:
                return False
        return True
438026
def check_complete(task, out_queue):
    
    logger.debug("Checking if %s is complete", task)
    try:
        is_complete = task.complete()
    except Exception:
        is_complete = TracebackWrapper(traceback.format_exc())
    out_queue.put((task, is_complete))
146094
def _check(self, accepted):
        """"""
        # logging.debug('A check is now happening...')
        # for key in self.statediag[1].trans:
        #    logging.debug('transition to '+`key`+" with "+self.statediag[1].trans[key][0])
        total = []
        if 1 in self.quickresponse:
            total = total + self.quickresponse[1]
        if (1, 0) in self.quickresponse:
            total = total + self.quickresponse[(1, 0)]
        for key in total:
            if (key.id == 1 or key.id == (1, 0)) and key.type == 3:
                if accepted is None:
                    if 2 in key.trans:
                        # print 'Found'
                        return key.trans[2]
                else:
                    for state in accepted:
                        if (2, state) in key.trans:
                            # print 'Found'
                            return key.trans[(2, state)]
        return -1
719718
def check(self, final_line_count):
        """"""
        if self._lines_seen["version"]:
            self._process_version_lines()
        self._process_plan_lines(final_line_count)
229485
def is_finished(self):
        """"""

        if self._total_time > self._global_time_limit:
            logger.warning("Exceeded global time limit {} / {}".format(
                self._total_time, self._global_time_limit))
            return True

        trials_done = all(trial.is_finished() for trial in self._trials)
        return trials_done and self._search_alg.is_finished()
239021
def triggered(self):
        
        if self.stop is not None and not self.stop_reached:
            return False

        if self.limit is not None and not self.limit_reached:
            return False

        return True
76644
def check(self):
        '''  '''
        if self.lastrun + self.interval < time.time():
            return True
        else:
            return False
286388
def isFinished(self):
        
        finished = (self.env._step == len(self.env.profile))
        if finished:
            logger.info("Finished episode.")
        return finished
108495
def done(self, on_success=None, on_failure=None):
        """"""
        if on_success is not None:
            if self._state == 'pending':
                self._callbacks.append(on_success)
            elif self._state == 'resolved':
                on_success(self.value)
        if on_failure is not None:
            if self._state == 'pending':
                self._errbacks.append(on_failure)
            elif self._state == 'rejected':
                on_failure(self.reason)
        return self
276509
def _mark_context_complete(marker, context, has_errors):
    """"""

    current = None

    if marker:
        current = marker.key.get()

    if not current:
        return False

    if current and current.complete:
        return False

    current.complete = True
    current.has_errors = has_errors
    current.put()

    # Kick off completion tasks.
    _insert_post_complete_tasks(context)

    return True
220753
private void checkFinishedPartitions() {

        List<String> failingPartitionSeen = new ArrayList<String>();
        boolean stoppedPartitionSeen = false;

        for (PartitionReplyMsg replyMsg : finishedWork) {
            BatchStatus batchStatus = replyMsg.getBatchStatus();

            if (logger.isLoggable(Level.FINE)) {
                logger.fine("For partitioned step: " + getStepName() + ", the partition # " +
                            replyMsg.getPartitionPlanConfig().getPartitionNumber() + " ended with status '" + batchStatus);
            }

            // Keep looping, just to see the log messages perhaps.
            if (batchStatus.equals(BatchStatus.FAILED)) {

                String msg = "For partitioned step: " + getStepName() + ", the partition # " +
                             replyMsg.getPartitionPlanConfig().getPartitionNumber() + " ended with status '" + batchStatus;
                failingPartitionSeen.add(msg);
            }
            // This code seems to suggest it might be valid for a partition to end up in STOPPED state without
            // the "top-level" step having been aware of this.   It's unclear from the spec if this is even possible
            // or a desirable spec interpretation.  Nevertheless, we'll code it as such noting the ambiguity.
            //
            // However, in the RI at least, we won't bother updating the step level BatchStatus, since to date we
            // would only transition the status in such a way independently.
            if (batchStatus.equals(BatchStatus.STOPPED)) {
                stoppedPartitionSeen = true;
            }
        }

        if (!failingPartitionSeen.isEmpty()) {
            markStepForFailure();
            rollbackPartitionedStep();
            throw new BatchContainerRuntimeException("One or more partitions failed: " + failingPartitionSeen);
        } else if (isStoppingStoppedOrFailed()) {
            rollbackPartitionedStep();
        } else if (stoppedPartitionSeen) {

            // At this point, the top-level job is still running.
            // If we see a stopped partition, we mark the step/job failed
            markStepForFailure();
            rollbackPartitionedStep();
        } else {
            // Call before completion
            if (this.partitionReducerProxy != null) {
                this.partitionReducerProxy.beforePartitionedStepCompletion();
            }
        }

    }
69718
public boolean isFinished()
	{
		if (finished)
			return true;

		try
		{
			final int code = exitCode();

			finished(code);

			return true;
		}
		catch (IllegalThreadStateException e)
		{
			return false;
		}
	}