{time, state, taskID, taskType}
973833
@Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        LogRecord log = logRecords.get(rowIndex);
        if (log != null) {
            Object[] params = log.getParameters();
            switch (columnIndex) {
                case 0:
                    return Integer.parseInt((String) log.getParameters()[0]);
                case 1:
                    if (params != null) {
                        return log.getParameters()[1];
                    }
                    break;
                case 2:
                	if (params != null) {
                        Automaton aut = (Automaton) params[5];
                        return aut.getAgent().getId();
                    }
                    return log.getLoggerName();
                case 3:
                    if (params != null) {
                        return params[2];
                    }
                    break;
                case 4:
                    if (params != null) {
                        return params[3];
                    }
                    break;
                case 5:
                    if (params != null) {
                        return params[4];
                    }
                    break;
                case 6:
                    if (params != null) {
                        Automaton aut = (Automaton) params[5];
                        return aut.getFinishCondition();
                    }
                    break;
                case 7:
                    return log.getMessage();
            }
        }
        return "";
    }
884003
public void updateDueDate(int taskId, LocalDate dueDate) {
		getResourceFactory()
				.getApiResource("/task/" + taskId + "/due_date")
				.entity(new TaskDueDate(dueDate),
						MediaType.APPLICATION_JSON_TYPE).put();
	}
924575
private Element toElement(ScheduleTask task) {
	Element el = doc.createElement("task");
	setAttributes(el, task);
	return el;
    }
939119
@Override
  public Optional<String> trySchedule(final Tasklet tasklet) {
    for (int i = 0; i < idList.size(); i++) {
      final int index = (nextIndex + i) % idList.size();
      final String workerId = idList.get(index);
      
      if (idLoadMap.get(workerId) < workerCapacity) {
        nextIndex = (index + 1) % idList.size();
        return Optional.of(workerId);
      }
    }
    return Optional.empty();
  }
482140
def effective_task_id(self):
        
        params = self.param_kwargs
        if 'date' in params and is_closest_date_parameter(self, 'date'):
            params['date'] = self.closest()
            task_id_parts = sorted(['%s=%s' % (k, str(v)) for k, v in params.items()])
            return '%s(%s)' % (self.task_family, ', '.join(task_id_parts))
        else:
            return self.task_id
518355
public String schedule(String pattern, Task task) {
		String id = UUID.randomUUID().toString();
		schedule(id, pattern, task);
		return id;
	}
1277468
public Task pollTask(String taskType, String workerId, String domain) {
        Preconditions.checkArgument(StringUtils.isNotBlank(taskType), "Task type cannot be blank");
        Preconditions.checkArgument(StringUtils.isNotBlank(domain), "Domain cannot be blank");
        Preconditions.checkArgument(StringUtils.isNotBlank(workerId), "Worker id cannot be blank");

        Object[] params = new Object[]{"workerid", workerId, "domain", domain};
        Task task = getForEntity("tasks/poll/{taskType}", params, Task.class, taskType);
        populateTaskInput(task);
        return task;
    }
73591
function() {

		var time = new Date().getTime(),
			i = 0,
			count = this._active_tasks.length,
			task,
			active_tasks = [];

		for (; i < count; i++) {

			task = this._active_tasks[i];

			if (task.isRunning()) {
				task.onTimer(time);
				// note: at this moment task may be already off, but it's not checked - to save processor resources.
				active_tasks.push(task);
			}

		}

		if (!active_tasks.length) {

			this.is_running = false;

		}

		this._active_tasks = active_tasks;

	}
51143
function _tock() {
    var config = this._config;
    var now = Date.now();
    var taskTime = now - this._started; // The time it took to finish the last task
    var delay = Math.max(0, config.delay - (taskTime)); // Delay until the next task is run

    if (config.limit) {
      this._count += 1;

      if (this._count >= config.limit) {
        this.stop();

        return;
      }
    }

    this._before = this._started;
    this._started = now + delay;

    this._timeout = setTimeout(this._tick, delay);
  }
1055739
def view_task_info(token, dstore):
    
    args = token.split(':')[1:]  # called as task_info:task_name
    if args:
        [task] = args
        array = dstore['task_info/' + task].value
        rduration = array['duration'] / array['weight']
        data = util.compose_arrays(rduration, array, 'rduration')
        data.sort(order='duration')
        return rst_table(data)

    data = ['operation-duration mean stddev min max outputs'.split()]
    for task in dstore['task_info']:
        val = dstore['task_info/' + task]['duration']
        if len(val):
            data.append(stats(task, val))
    if len(data) == 1:
        return 'Not available'
    return rst_table(data)
1163185
private void readWBS(ChildTaskContainer parent, Integer id)
   {
      Integer currentID = id;
      Table table = getTable("WBSTAB");

      while (currentID.intValue() != 0)
      {
         MapRow row = table.find(currentID);
         Integer taskID = row.getInteger("TASK_ID");
         Task task = readTask(parent, taskID);
         Integer childID = row.getInteger("CHILD_ID");
         if (childID.intValue() != 0)
         {
            readWBS(task, childID);
         }
         currentID = row.getInteger("NEXT_ID");
      }
   }
898325
public static <V> Predicate<TaskContext<V>> afterDelay(long time, TimeUnit timeUnit) {
        return ctx -> (System.currentTimeMillis() - ctx.getStartTime()) >= timeUnit.toMillis(time);
    }
128439
def state(self, time=None):
        
        if time is None:
            return max(self.infos(type=State), key=attrgetter('creation_time'))
        else:
            states = [
                s for s in self.infos(type=State) if s.creation_time < time]
            return max(states, key=attrgetter('creation_time'))
1307076
public static void logInvalidTaskType(final Logger logger,
			final TaskTypes type)
	{

		logger.logMessage(Level.INFO, "Invalid TaskType: " + type);
	}
657834
def get_task_ops(task_type=TaskType.ALG_CTRL):
    
    try:
      return LearnToExecuteState.TASK_TYPE_OPS[task_type]
    except KeyError:
      raise KeyError("Bad task_type '%s', check config." % task_type)
566102
public void showDataIOEditor(final String taskName,
                                 final String datainput,
                                 final String datainputset,
                                 final String dataoutput,
                                 final String dataoutputset,
                                 final String processvars,
                                 final String assignments,
                                 final String datatypes,
                                 final String disallowedpropertynames,
                                 final String customassignmentproperties,
                                 final JavaScriptObject jscallback) {

        //getDataIOEditorData("{ \"a\":\"hello\" }", jscallback);
        final DesignerPresenter dp = this;
        activityDataIOEditor.setCallback(
                new ActivityDataIOEditor.GetDataCallback() {
                    @Override
                    public void getData(String data) {
                        dp.getDataIOEditorData(data,
                                               jscallback);
                    }
                }
        );

        String inputvars = null;
        boolean hasInputVars = false;
        boolean isSingleInputVar = false;
        if (datainput != null) {
            inputvars = datainput;
            hasInputVars = true;
            isSingleInputVar = true;
        }
        if (datainputset != null) {
            inputvars = datainputset;
            hasInputVars = true;
            isSingleInputVar = false;
        }

        String outputvars = null;
        boolean hasOutputVars = false;
        boolean isSingleOutputVar = false;
        if (dataoutput != null) {
            outputvars = dataoutput;
            hasOutputVars = true;
            isSingleOutputVar = true;
        }
        if (dataoutputset != null) {
            outputvars = dataoutputset;
            hasOutputVars = true;
            isSingleOutputVar = false;
        }

        AssignmentData assignmentData = new AssignmentData(inputvars,
                                                           outputvars,
                                                           processvars,
                                                           assignments,
                                                           datatypes,
                                                           disallowedpropertynames,
                                                           customassignmentproperties);
        assignmentData.setVariableCountsString(hasInputVars,
                                               isSingleInputVar,
                                               hasOutputVars,
                                               isSingleOutputVar);
        activityDataIOEditor.setAssignmentData(assignmentData);
        activityDataIOEditor.setDisallowedPropertyNames(assignmentData.getDisallowedPropertyNames());
        activityDataIOEditor.setInputAssignmentRows(assignmentData.getAssignmentRows(Variable.VariableType.INPUT));
        activityDataIOEditor.setOutputAssignmentRows(assignmentData.getAssignmentRows(Variable.VariableType.OUTPUT));
        activityDataIOEditor.setDataTypes(assignmentData.getDataTypes(),
                                          assignmentData.getDataTypeDisplayNames());
        activityDataIOEditor.setProcessVariables(assignmentData.getProcessVariableNames());
        activityDataIOEditor.setCustomAssignmentsProperties(assignmentData.getCustomAssignmentProperties());

        activityDataIOEditor.configureDialog(taskName,
                                             hasInputVars,
                                             isSingleInputVar,
                                             hasOutputVars,
                                             isSingleOutputVar);
        activityDataIOEditor.show();
    }
310985
private void dumpStatus(long now) {
    if (now - lastDumpStatusTime < dumpStatusPeriod) {
      return;
    }
    lastDumpStatusTime = now;
    logJobStats(infos.keySet(), TaskType.MAP);
    logJobStats(infos.keySet(), TaskType.REDUCE);
    dumpSpeculationStatus(now);
  }