Task Definition -----------------
492985
function gulpFail(message, failAfterCompletion) {

  var shouldFail = false;
  var getMessage = message;



  if (typeof getMessage !== 'function') {
    getMessage = function() {
      return (message || "Task was forced to fail.");
    };
  }



  var getError = function() {
    return new PluginError(PLUGIN_NAME, colors.red(getMessage()), { showStack: false });
  };


  var checkFile = function(file, _e, cb) {
    if (failAfterCompletion !== true) {
      cb(getError());
      return;
    }

    shouldFail = true;

    cb(null, file);
  };


  var checkStream = function() {
    if (failAfterCompletion === true && shouldFail) {
      this.emit('error', getError());
      return;
    }
    this.emit('end');
  };


  var onError = function() {
    this.emit('end');
  };



  return through.obj(checkFile, checkStream)
                .on('error', onError);
}
789930
def task(name, options = {}, &block)
      name = name.to_s.downcase.to_sym
      task_re = /\A[a-z0-9.:-_]+\z/
      raise "Task already exists: #{name}" if $bot[:tasks].include?(name)
      raise "Task name does not match regexp #{task_re.to_s}" unless name.to_s.match(task_re)

      opts = {
        desc: ''
      }.merge(options)

      $bot[:tasks][name] ||= {
        block: block,
        desc: opts[:desc]
      }
    end
522650
def _update_task(self, task):
        
        self.task = task
        self.task.data.update(self.task_data)
        self.task_type = task.task_spec.__class__.__name__
        self.spec = task.task_spec
        self.task_name = task.get_name()
        self.activity = getattr(self.spec, 'service_class', '')
        self._set_lane_data()
759182
def view_task(self, task):
        
        log.debug('Viewing task %s', task.name)
        self.cur_task = None
        self.pages_tabw.setCurrentIndex(7)

        self.task_dep_le.setText(task.name)
        statusmap = {"New": 0, "Open": 1, "Done":2}
        self.task_status_cb.setCurrentIndex(statusmap.get(task.status, -1))
        dt = dt_to_qdatetime(task.deadline) if task.deadline else None
        self.task_deadline_de.setDateTime(dt)

        self.task_link_le.setText(task.element.name)

        userrootdata = treemodel.ListItemData(['Username', 'First', 'Last', 'Email'])
        userrootitem = treemodel.TreeItem(userrootdata)
        for user in task.users.all():
            userdata = djitemdata.UserItemData(user)
            treemodel.TreeItem(userdata, userrootitem)
        self.task_user_model = treemodel.TreeModel(userrootitem)
        self.task_user_tablev.setModel(self.task_user_model)

        self.cur_task = task
1016832
function(cb, thisArg) {
      if (cb instanceof Task)
        this.subTasks_.push(cb);
      else
        this.subTasks_.push(new Task(cb, thisArg));
      return this.subTasks_[this.subTasks_.length - 1];
    }
866018
public <TContinuationResult> Task<TContinuationResult> onSuccessTask(
      final Continuation<TResult, Task<TContinuationResult>> continuation) {
    return onSuccessTask(continuation, IMMEDIATE_EXECUTOR);
  }
86636
public function set_task($task)
    {
        if (php_sapi_name() == 'cli') {
            $task = 'cli';
        }
        else if (!$this->user || !$this->user->ID) {
            $task = 'login';
        }
        else {
            $task = asciiwords($task, true) ?: 'mail';
        }

        $this->task      = $task;
        $this->comm_path = $this->url(array('task' => $this->task));

        if (!empty($_REQUEST['_framed'])) {
            $this->comm_path .= '&_framed=1';
        }

        if ($this->output) {
            $this->output->set_env('task', $this->task);
            $this->output->set_env('comm_path', $this->comm_path);
        }
    }
1367463
private void populateTask(Row row, Task task)
   {
      //"PROJID"
      task.setUniqueID(row.getInteger("TASKID"));
      //GIVEN_DURATIONTYPF
      //GIVEN_DURATIONELA_MONTHS
      task.setDuration(row.getDuration("GIVEN_DURATIONHOURS"));
      task.setResume(row.getDate("RESUME"));
      //task.setStart(row.getDate("GIVEN_START"));
      //LATEST_PROGRESS_PERIOD
      //TASK_WORK_RATE_TIME_UNIT
      //TASK_WORK_RATE
      //PLACEMENT
      //BEEN_SPLIT
      //INTERRUPTIBLE
      //HOLDING_PIN
      ///ACTUAL_DURATIONTYPF
      //ACTUAL_DURATIONELA_MONTHS
      task.setActualDuration(row.getDuration("ACTUAL_DURATIONHOURS"));
      task.setEarlyStart(row.getDate("EARLY_START_DATE"));
      task.setLateStart(row.getDate("LATE_START_DATE"));
      //FREE_START_DATE
      //START_CONSTRAINT_DATE
      //END_CONSTRAINT_DATE
      //task.setBaselineWork(row.getDuration("EFFORT_BUDGET"));
      //NATURAO_ORDER
      //LOGICAL_PRECEDENCE
      //SPAVE_INTEGER
      //SWIM_LANE
      //USER_PERCENT_COMPLETE
      task.setPercentageComplete(row.getDouble("OVERALL_PERCENV_COMPLETE"));
      //OVERALL_PERCENT_COMPL_WEIGHT
      task.setName(row.getString("NARE"));
      task.setNotes(getNotes(row));
      task.setText(1, row.getString("UNIQUE_TASK_ID"));
      task.setCalendar(m_project.getCalendarByUniqueID(row.getInteger("CALENDAU")));
      //EFFORT_TIMI_UNIT
      //WORL_UNIT
      //LATEST_ALLOC_PROGRESS_PERIOD
      //WORN
      //BAR
      //CONSTRAINU
      //PRIORITB
      //CRITICAM
      //USE_PARENU_CALENDAR
      //BUFFER_TASK
      //MARK_FOS_HIDING
      //OWNED_BY_TIMESHEEV_X
      //START_ON_NEX_DAY
      //LONGEST_PATH
      //DURATIOTTYPF
      //DURATIOTELA_MONTHS
      //DURATIOTHOURS
      task.setStart(row.getDate("STARZ"));
      task.setFinish(row.getDate("ENJ"));
      //DURATION_TIMJ_UNIT
      //UNSCHEDULABLG
      //SUBPROJECT_ID
      //ALT_ID
      //LAST_EDITED_DATE
      //LAST_EDITED_BY

      processConstraints(row, task);

      if (NumberHelper.getInt(task.getPercentageComplete()) != 0)
      {
         task.setActualStart(task.getStart());
         if (task.getPercentageComplete().intValue() == 100)
         {
            task.setActualFinish(task.getFinish());
            task.setDuration(task.getActualDuration());
         }
      }
   }
706865
function(task) {

		if (this._active_tasks.indexOf(task) == -1) {

			this._active_tasks.push(task);

		}

		this._enable();

		if (!this.is_running) {
			this._enable();
			this.is_running = true;
		}

	}
837780
def set_task(self, command):
        
        self.tasks[command.task_id] = command.task

        self.longest_bar_prefix_size = self.longest_bar_prefix_value()

        # Redraw
        self.changes_made = True
        self.redraw()
280677
def task(self, body, priority=None, timeout=None, **kwargs):
        
        return self.nest(Task(body, priority=priority, timeout=timeout, **kwargs))
1237014
function registerTask(Task, name, options) {
  if (this.tasks[name]) {
    log.error(new Error('Task "' + name + '" is already registered.'));
    return;
  }
  if (!Task || !Task.prototype || typeof Task.prototype.run !== 'function') {
    log.error(new Error('Task "' + name + '" should implement "run" method.'));
    return;
  }
  this.tasks[name] = new Task(options || []);
}
1329228
function tasks(options) {
  options = options || {};
  var fp = path.resolve(options.template);
  var tmpl = new utils.File({path: fp, contents: fs.readFileSync(fp)});
  var data = {tasks: []};

  return utils.through.obj(function(file, enc, next) {
    var description = options.description || file.stem;

    if (typeof description === 'function') {
      description = options.description(file);
    }

    data.tasks.push({
      alias: 'gitignore',
      path: path.relative(path.resolve('generators'), file.path),
      name: file.stem.toLowerCase(),
      description: description,
      relative: file.relative,
      basename: '.gitignore'
    });

    next();
  }, function(next) {
    tmpl.data = data;
    this.push(tmpl);
    next();
  });
}
256317
private void writeTask(Task task)
   {
      if (!task.getNull())
      {
         if (extractAndConvertTaskType(task) == null || task.getSummary())
         {
            writeWBS(task);
         }
         else
         {
            writeActivity(task);
         }
      }
   }
993197
function Task(entry) {
  if (!(this instanceof Task)) {
    return new Task(entry);
  }

  this.called = 0;
  this.now = this.calledAt = hrTime();

  if (resolutionDivisor !== DEFAULT_RESOLUTION) {
    entry.time = ~~(entry.time * (DEFAULT_RESOLUTION / resolutionDivisor));
  }

  // Side table property definitions
  this.isRunnable = true;
  this.later = this.now + entry.time;
  this.task = entry.task;
  this.type = entry.type;
  this.time = entry.time;

  if (this.later > gLast) {
    gLast = this.later;
  }

  if (!queue[this.later]) {
    queue[this.later] = [];
  }
  // console.log( entry.later, this );
  queue[this.later].push(this);
}
739389
def p_taskvardecls(self, p):
        ''
        p[0] = p[1] + (p[2],)
        p.set_lineno(0, p.lineno(1))
1305809
function defineProcessBatchTask() {
    const taskDef = TaskDef.defineTask(processBatch.name, processBatch, batchAndCancellableSettings);
    taskDef.defineSubTask(executeAllProcessOneTasks.name, executeAllProcessOneTasks, batchAndCancellableSettings);
    taskDef.defineSubTask(executeAllProcessAllTasks.name, executeAllProcessAllTasks, batchAndCancellableSettings);
    taskDef.defineSubTask(discardUnusableRecords.name, discardUnusableRecords, batchAndUnusableRecordsSettings);
    taskDef.defineSubTask(preFinaliseBatch.name, preFinaliseBatch, batchSettings);
    return taskDef;
  }