Marks a set of tasks as dependencies of this task, if they are not
already dependencies. *A task can have at most 15 dependencies.*

@param  task The task to add dependencies to.
@return Request object
551919
public ItemRequest<Task> addDependencies(String task) {
    
        String path = String.format("/tasks/%s/addDependencies", task);
        return new ItemRequest<Task>(this, Task.class, path, "POST");
    }
1130525
public static Callable<Object> callable(Runnable task) {
        if (task == null)
            throw new NullPointerException();
        return new RunnableAdapter<Object>(task, null);
    }
1014109
private function _getCreateTaskContext(Task $task)
    {
        $result = new HttpCallContext();
        $result->setMethod(Resources::HTTP_POST);
        $result->setHeaders($this->_batchHeaders);
        $result->setUri($this->getUri());
        $result->setPath('/$1/Tasks');
        $result->setBody($this->wrapAtomEntry($task));
        $result->addStatusCode(Resources::STATUS_CREATED);

        return $result;
    }
412526
final int externalHelpComplete(CountedCompleter<?> task, int maxTasks) {
        WorkQueue[] ws; int wl;
        int r = ThreadLocalRandom.getProbe();
        return ((ws = workQueues) != null && (wl = ws.length) > 0) ?
            helpComplete(ws[(wl - 1) & r & SQMASK], task, maxTasks) : 0;
    }
214668
private void setTasks(String tasks) {
		for (String task : tasks.split(",")) {
			if (KNOWN_TASKS.containsKey(task)) {
				this.tasks |= KNOWN_TASKS.get(task);
				this.taskName += (this.taskName.isEmpty() ? "" : "-") + task;
			} else {
				logger.warn("Unsupported RDF serialization task \"" + task
						+ "\". Run without specifying any tasks for help.");
			}
		}
	}
1093071
def count_buildable_tasks(self):
        """"""
        self.update_tasks_status()
        buildable_tasks_count = 0
        for key, task in self.tasks.iteritems():
            if task.state is Task.State.NEW:
                if self.are_dependencies_buildable(task):
                    buildable_tasks_count += 1
                    logging.debug("Buildable task: %s" % task.name )
                else:
                    logging.debug("Task %s has broken dependencies." % task.name )

        return buildable_tasks_count
972465
private TaskDescriptor createTaskDescriptorForStreamCombineOperations(DStreamOperation streamOperation){

		TaskDescriptor taskDescriptor = this.createTaskDescriptor(streamOperation.getLastOperationName());
		for (DStreamExecutionGraph dependentOps : streamOperation.getCombinableExecutionGraphs()) {
			TaskDescriptorChainBuilder builder = new TaskDescriptorChainBuilder(executionName, dependentOps, executionConfig);
			List<TaskDescriptor> dependentDescriptors = builder.build();
			taskDescriptor.addDependentTasksChain(dependentDescriptors);
		}
		return taskDescriptor;
	}
834377
public ItemRequest<Task> removeProject(String task) {
    
        String path = String.format("/tasks/%s/removeProject", task);
        return new ItemRequest<Task>(this, Task.class, path, "POST");
    }
897609
public FileDownloadQueueSet downloadTogether(List<BaseDownloadTask> tasks) {
        this.isSerial = false;
        this.tasks = new BaseDownloadTask[tasks.size()];
        tasks.toArray(this.tasks);

        return this;

    }
807440
@GuardedBy("evictionLock")
    void runTasksInChain(Task task) {
        while (task != null) {
            Task current = task;
            task = task.getNext();
            current.setNext(null);
            current.run();
        }
    }
1275107
public function setTask(Task $task = null)
    {
        $this->task = $task;
        if (null !== $task) {
            $task->addTransition($this);
        }

        return $this;
    }
708196
public CollectionRequest<Task> tags(String task) {
    
        String path = String.format("/tasks/%s/tags", task);
        return new CollectionRequest<Task>(this, Task.class, path, "GET");
    }
378370
def addTask(self, task):
        
        with self.regcond:
            self.taskset.append(task)
            task.add_callback('resolved', self.child_done, self.numtasks)
            self.numtasks += 1
            self.count += 1

        task.initialize(self)
        task.start()
29717
def add_task(self, task):
        
        if not self._valid_name(task.name):
            raise ValueError(task.name)

        self._tasks[task.name] = task

        incomplete_dependencies = set()

        for dependency in task.dependencies:
            if not self._valid_name(dependency) or dependency in self._failed:
                # there may already be tasks dependent on this one.
                self._cascade_failure(task.name)

                break

            if dependency not in self._completed:
                incomplete_dependencies.add(dependency)
        else:  # task hasn't failed
            try:
                self._graph.add(task.name, incomplete_dependencies)
            except ValueError:
                self._cascade_failure(task.name)
326518
public ItemRequest<Task> dependents(String task) {
    
        String path = String.format("/tasks/%s/dependents", task);
        return new ItemRequest<Task>(this, Task.class, path, "GET");
    }
1233299
def addTask(self, task):
        
        # Try to start task first.  If it fails then we don't need to
        # undo adding it to taskset
        task.initialize(self)
        task.start()

        with self._lock_c:
            self.numtasks += 1
            self.taskset.append(task)
15677
public final void addPrerequisite(final Task<?> task) {
        Logger.v("Task[%s] add prerequisite: Task[%s]", this, task);

        synchronized (mTaskLock) {
            if (!mPrerequisites.contains(task)) {
                mPrerequisites.add(task);
                task.addDependency(this);
            }
        }
    }