Return a boolean to indicate if we need to reschedule another bracket iteration.
427532
def should_reduce_configs(self, iteration, bracket_iteration):
        """"""
        n_configs_to_keep = self.get_n_config_to_keep_for_iteration(
            iteration=iteration, bracket_iteration=bracket_iteration)
        return n_configs_to_keep > 0
735741
def _reschedule(self, node):
        

        # Do not add more work to a node shutting down
        if node.shutting_down:
            return

        # Check that more work is available
        if not self.workqueue:
            node.shutdown()
            return

        self.log("Number of units waiting for node:", len(self.workqueue))

        # Check that the node is almost depleted of work
        # 2: Heuristic of minimum tests to enqueue more work
        if self._pending_of(self.assigned_work[node]) > 2:
            return

        # Pop one unit of work and assign it
        self._assign_work_unit(node)
460529
def CheckDisjointCalendars(self):
    
    # TODO: Do an exact check here.

    a_service_periods = self.feed_merger.a_schedule.GetServicePeriodList()
    b_service_periods = self.feed_merger.b_schedule.GetServicePeriodList()

    for a_service_period in a_service_periods:
      a_start, a_end = a_service_period.GetDateRange()
      for b_service_period in b_service_periods:
        b_start, b_end = b_service_period.GetDateRange()
        overlap_start = max(a_start, b_start)
        overlap_end = min(a_end, b_end)
        if overlap_end >= overlap_start:
          return False
    return True
826111
def xmlrpc_reschedule(self):
        
        if not len(self.scheduled_tasks) == 0:
            self.reschedule = list(self.scheduled_tasks.items())
            self.scheduled_tasks = {}
        return True
891393
def _pull_schedule_loop(self):
        
        try:
            self.pull_schedule()
            delay = 16*60
        except ScheduleError, e:
            self.l.exception("ScheduleError while pulling schedule.  "+
                             "Retrying in 5m")
            delay = 5*60
        if not self.running:
            return
        self.scheduler.plan(time.time() + delay, self._pull_schedule_loop)
1215696
private void reschedule() {
        // set up a daily roll
        Calendar cal = Calendar.getInstance();
        long today = cal.getTimeInMillis();

        // adjust to somewhere after midnight of the next day
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.add(Calendar.DATE, 1);
        long tomorrow = cal.getTimeInMillis();

        if (executorService != null) {
            future = executorService.schedule(this, tomorrow - today, TimeUnit.MILLISECONDS);
        }
    }
1116912
private boolean isScheduled(JobInProgress job) {
    return ((job.pendingMaps() < job.desiredMaps()) 
        || (job.pendingReduces() < job.desiredReduces()));
  }
193877
public Boolean isSchedulerPaused() {
        try {
            return this.scheduler.isInStandbyMode();
        } catch (SchedulerException e) {
            logger.error("error retrieveing scheduler condition", e);
        }
        return null;
    }
154932
@Override
    public boolean cancel(boolean mayInterruptIfRunning) {
        if (m_isDone == true) {
            return false;
        }
        m_isDone = true;

        if (m_pendingException != null) {
            return false;
        }

        m_cancelResult = m_schedFuture.cancel(false);

        if ((m_cancelResult != true) || (m_defaultFuture != null)) {
            // Push the cancel call to the Default Executor Future if it has progressed that far.
            try {
                this.m_coordinationLatch.await();
            } catch (InterruptedException ie) {
                // Try to proceed.
            }

            if (m_defaultFuture != null) {
                m_cancelResult = m_defaultFuture.cancel(mayInterruptIfRunning);
            }
        }

        if (m_cancelResult == true) {
            m_pendingException = new CancellationException();
            m_scheduledExecutorQueue.remove(this);
        }

        // Let get() finish
        this.m_coordinationLatch.countDown();

        return m_cancelResult;
    }
822714
def _schedule(self, when):
        
        sched = IScheduler(self.store)
        for scheduledAt in sched.scheduledTimes(self):
            if when < scheduledAt:
                sched.reschedule(self, scheduledAt, when)
            break
        else:
            sched.schedule(self, when)
819586
protected void reschedule(long minTimeoutAt) {
		if (minTimeoutAt == Long.MAX_VALUE) {
			for (PendingPromise pending : promises.values()) {
				if (pending.timeoutAt > 0 && pending.timeoutAt < minTimeoutAt) {
					minTimeoutAt = pending.timeoutAt;
				}
			}
			long timeoutAt;
			requestStreamReadLock.lock();
			try {
				for (IncomingStream stream : requestStreams.values()) {
					timeoutAt = stream.getTimeoutAt();
					if (timeoutAt > 0 && timeoutAt < minTimeoutAt) {
						minTimeoutAt = timeoutAt;
					}
				}
			} finally {
				requestStreamReadLock.unlock();
			}
			responseStreamReadLock.lock();
			try {
				for (IncomingStream stream : responseStreams.values()) {
					timeoutAt = stream.getTimeoutAt();
					if (timeoutAt > 0 && timeoutAt < minTimeoutAt) {
						minTimeoutAt = timeoutAt;
					}
				}
			} finally {
				responseStreamReadLock.unlock();
			}
		}
		long now = System.currentTimeMillis();
		if (minTimeoutAt == Long.MAX_VALUE) {
			ScheduledFuture<?> t = callTimeoutTimer.get();
			if (t != null) {
				if (prevTimeoutAt.get() > now) {
					t.cancel(false);
					prevTimeoutAt.set(0);
				} else {
					callTimeoutTimer.set(null);
					prevTimeoutAt.set(0);
				}
			}
		} else {
			minTimeoutAt = (minTimeoutAt / 100 * 100) + 100;
			long prev = prevTimeoutAt.getAndSet(minTimeoutAt);
			if (prev == minTimeoutAt) {

				// Next when not changed
				return;
			}

			// Stop previous timer
			ScheduledFuture<?> t = callTimeoutTimer.get();
			if (t != null) {
				t.cancel(false);
			}

			// Schedule next timeout timer
			long delay = Math.max(10, minTimeoutAt - now);
			callTimeoutTimer.set(scheduler.schedule(this::checkTimeouts, delay, TimeUnit.MILLISECONDS));
		}
	}
1202272
boolean maybeSchedule()
    {
        if (pool.spinningCount.get() > 0 || !takeWorkPermit(true))
            return false;

        pool.schedule(new Work(this));
        return true;
    }
809575
function () {
        var pending = this._pending,
            done = this._done,
            a,
            b;
        while (0 !== pending.length) {
            b = pending.pop();
            a = pending.pop();
            done.push(a, b);
            if (this._areDifferent(a, b)) {
                return false;
            }
        }
        return true;
    }
1192938
def _onOffset(self, dt, businesshours):
        
        # if self.normalize and not _is_normalized(dt):
        #     return False
        # Valid BH can be on the different BusinessDay during midnight
        # Distinguish by the time spent from previous opening time
        if self.n >= 0:
            op = self._prev_opening_time(dt)
        else:
            op = self._next_opening_time(dt)
        span = (dt - op).total_seconds()
        if span <= businesshours:
            return True
        else:
            return False
1142212
public void resendScheduledRejects()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "resendScheduledRejects");

    _rejectedTOM.driveAllActiveEntries();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "resendScheduledRejects");
  }
1065582
public boolean isRestartScheduled() {
        for (UpdateCenterJob job : getJobs()) {
            if (job instanceof RestartJenkinsJob) {
                RestartJenkinsJob.RestartJenkinsJobStatus status = ((RestartJenkinsJob) job).status;
                if (status instanceof RestartJenkinsJob.Pending
                        || status instanceof RestartJenkinsJob.Running) {
                    return true;
                }
            }
        }
        return false;
    }
1055442
function(a, b) {
        if ((a.timesNotSelected || 0) < b.timesNotSelected) {
            return -1;
        }
        else if ((a.timesNotSelected || 0) > b.timesNotSelected) {
            return 1;
        }
        return 0;
    }