if any coordinator task is executed at all.
966348
private boolean isCoordinatorStatsUsable(boolean incremental) {
        if (m_coordinatorTask == null) {
            return false;
        }
        if (incremental) {
            return m_coordinatorTask.m_timedInvocations - m_coordinatorTask.m_lastTimedInvocations > 0;
        }
        return m_coordinatorTask.m_timedInvocations > 0;
    }
490483
def should_execute(self, workload):
        
        if not self._suspended.is_set():
            return True
        workload = unwrap_workload(workload)
        return hasattr(workload, 'keep_alive') and getattr(workload, 'keep_alive')
316956
def monitor_tasks(self, tasks=None, status=None, age=None):
        ''''''
        self.engine_ready.wait()
        if not tasks:
            tasks = self.task_status.keys()
        else:
            tasks = [x for x in tasks if x in self.task_status]

        # we only monitor running tasks
        with threading.Lock():
            for task in tasks:
                if self.task_status[task] in (
                        'submitted',
                        'running') and task not in self.running_tasks:
                    # these tasks will be actively monitored
                    self.running_tasks.append(task)
        #
        if age is not None:
            age = expand_time(age, default_unit='d')
        return sorted([
            (x, self.task_status[x], self.task_info[x].get(
                'data', (time.time(), None, None)))
            for x in tasks
            if (status is None or self.task_status[x] in status) and
            (age is None or (
                (age > 0 and time.time() -
                 self.task_info[x].get('date',
                                       (time.time(), None, None))[0] > age) or
                (age < 0 and time.time() -
                 self.task_info[x].get('date',
                                       (time.time(), None, None))[0] < -age)))
        ],
                      key=lambda x: -x[2][0])
162755
def task(name, deps = None, fn = None):
	""""""
	if callable(deps):
		fn = deps
		deps = None

	if not deps and not fn:
		logger.log(logger.red("The task '%s' is empty" % name))
	else:
		tasks[name] = [fn, deps]
1106193
protected synchronized void postTaskExecution() {
		if (stopped) {
			// Stopped, so don't count the task(s) as done.
			// (worker threads call this method even if the task was not really executed.)
			return;
		}
		tasksDoneCount++;
		int percentageComplete = tasksDoneCount * 100 / tasksTotalCount;

		// Compute the progress and notify the listeners
		this.notifyListenersSpiderProgress(percentageComplete, tasksDoneCount, tasksTotalCount - tasksDoneCount);

		// Check for ending conditions
		if (tasksDoneCount == tasksTotalCount && initialized) {
			this.complete();
		}
	}
483899
function () {
      var i;
      for (i = 0; i < arguments.length; i++) {
         if ( ! (this.has_activity_completed(arguments[i]) || this.has_lambda_completed(arguments[i]) || this.childworkflow_completed(arguments[i])  || this.timer_fired(arguments[i]) ) ) {
            return false;
         }
      }
      return true;
   }
919199
def should_execute(self):
        """"""
        return self.args.apply and (self.args.no_confirm or self.confirm_execution())
221268
private boolean jobHasFinishedStatus() {

		final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(this, true);

		while (it.hasNext()) {

			if (it.next().getExecutionState() != ExecutionState.FINISHED) {
				return false;
			}
		}

		return true;
	}
330600
def on_task_status(self, task):
        """"""
        if not self.interactive:
            super(OneScheduler, self).on_task_status(task)

        try:
            procesok = task['track']['process']['ok']
        except KeyError as e:
            logger.error("Bad status pack: %s", e)
            return None

        if procesok:
            ret = self.on_task_done(task)
        else:
            ret = self.on_task_failed(task)
        if task['track']['fetch'].get('time'):
            self._cnt['5m_time'].event((task['project'], 'fetch_time'),
                                       task['track']['fetch']['time'])
        if task['track']['process'].get('time'):
            self._cnt['5m_time'].event((task['project'], 'process_time'),
                                       task['track']['process'].get('time'))
        self.projects[task['project']].active_tasks.appendleft((time.time(), task))
        return ret
738066
private void runSelectTask()
  {
    if (_lifecycle.isActive() || _lifecycle.isAfterStopping()) {
      log.warning(this + " cannot start because an instance is active");
      return;
    }

    initNative(_fd);

    synchronized (_thread) {
      _thread.notify();
    }

    if (! _lifecycle.toActive()) {
      log.warning(this + " invalid starting state");
      return;
    }

    runImpl();
  }
742193
public boolean tryMarkSlotActive(JobID jobId, AllocationID allocationId) {
		TaskSlot taskSlot = getTaskSlot(allocationId);

		if (taskSlot != null && taskSlot.isAllocated(jobId, allocationId)) {
			return taskSlot.markActive();
		} else {
			return false;
		}
	}
626708
public void execute(DelegateExecution execution) {
    boolean isSkipExpressionEnabled = SkipExpressionUtil.isSkipExpressionEnabled(execution, skipExpression);
    if (!isSkipExpressionEnabled || (isSkipExpressionEnabled && !SkipExpressionUtil.shouldSkipFlowElement(execution, skipExpression))) {

      if (Context.getProcessEngineConfiguration().isEnableProcessDefinitionInfoCache()) {
        ObjectNode taskElementProperties = Context.getBpmnOverrideElementProperties(serviceTaskId, execution.getProcessDefinitionId());
        if (taskElementProperties != null && taskElementProperties.has(DynamicBpmnConstants.SERVICE_TASK_CLASS_NAME)) {
          String overrideClassName = taskElementProperties.get(DynamicBpmnConstants.SERVICE_TASK_CLASS_NAME).asText();
          if (StringUtils.isNotEmpty(overrideClassName) && !overrideClassName.equals(className)) {
            className = overrideClassName;
            activityBehaviorInstance = null;
          }
        }
      }
      
      if (activityBehaviorInstance == null) {
        activityBehaviorInstance = getActivityBehaviorInstance();
      }

      try {
        activityBehaviorInstance.execute(execution);
      } catch (BpmnError error) {
        ErrorPropagation.propagateError(error, execution);
      } catch (RuntimeException e) {
        if (!ErrorPropagation.mapException(e, (ExecutionEntity) execution, mapExceptions))
          throw e;
      }
    }
  }
1170426
def idle_task(self):
        ''''''
        self.pstate.vehicle_name = self.vehicle_name
        self.pstate.fetch_check(self.master)
703786
public boolean hasNoEventToProcess() {

		long currentTime = Calendar.getInstance().getTimeInMillis();
		return watchEvents.isEmpty() && (currentTime - lastProcessTime.get() > bundlesHandler.getConfig()
				.getSmartBundlingDelayAfterLastEvent());
	}
131958
def isInteractive():
    
    if sys.stdout.isatty() and os.name != 'nt':
        #Hopefully everything but ms supports '\r'
        try:
            import threading
        except ImportError:
            return False
        else:
            return True
    else:
        return False
111357
final int helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) {
        int s;
        while ((s = task.status) >= 0 &&
               (joiner.isEmpty() ?
                tryHelpStealer(joiner, task) :
                joiner.tryRemoveAndExec(task)) != 0)
            ;
        return s;
    }
1218774
protected function execute_condition() {

        // Check it is included in the backup
        $fullpath = $this->task->get_taskbasepath();
        $fullpath = rtrim($fullpath, '/') . '/' . $this->filename;
        if (!file_exists($fullpath)) {
            // Not found, can't restore course logs
            return false;
        }

        return true;
    }