Creates an IndexableTaskItem from provided FunctionalTaskItem.

@param taskItem functional TaskItem
@return IndexableTaskItem
971229
public static IndexableTaskItem create(final FunctionalTaskItem taskItem) {
        return new IndexableTaskItem() {
            @Override
            protected Observable<Indexable> invokeTaskAsync(TaskGroup.InvocationContext context) {
                FunctionalTaskItem.Context fContext = new FunctionalTaskItem.Context(this);
                fContext.setInnerContext(context);
                return taskItem.call(fContext);
            }
        };
    }
1067913
public Task createTask(String name, Map<String, Object> attributes) {
        return getInstance().create().task(name, this, attributes);
    }
1344365
@Override
    public final TaskProcessor create(Task task)
        throws TaskProcessorCreationFailedException {
        if (isSupported(task)) {
            log.debug("creating task processor for " + task);
            AuditTask auditTask = new AuditTask();
            auditTask.readTask(task);
            return createImpl(auditTask);
        }

        throw new TaskProcessorCreationFailedException("Task is not an Audit task");

    }
369136
private void createTasksForTable(Table table,
                                     Collection<IndexSnapshotRequestConfig.PartitionRanges> partitionRanges,
                                     Map<Integer, Long> pidToLocalHSIDs,
                                     AtomicInteger numTables,
                                     SnapshotRegistry.Snapshot snapshotRecord)
    {
        // no work on this node
        if (pidToLocalHSIDs.isEmpty()) {
            return;
        }

        // create a null data target
        final DevNullSnapshotTarget dataTarget = new DevNullSnapshotTarget();
        final Runnable onClose = new TargetStatsClosure(dataTarget,
                                                        table.getTypeName(),
                                                        numTables,
                                                        snapshotRecord);
        dataTarget.setOnCloseHandler(onClose);
        m_targets.add(dataTarget);

        // go over all local sites, create a task for each source site
        for (IndexSnapshotRequestConfig.PartitionRanges partitionRange : partitionRanges) {
            Long localHSId = pidToLocalHSIDs.get(partitionRange.partitionId);

            // The partition may not exist on this node. If so, keep calm and carry on
            if (localHSId != null) {
                // based on the source partition, the predicate is different
                final SnapshotTableTask task =
                    new SnapshotTableTask(table,
                                          new SnapshotDataFilter[0],
                                          createIndexExpressionForTable(table, partitionRange.ranges),
                                          false);
                task.setTarget(dataTarget);

                placeTask(task, Arrays.asList(localHSId));
            }
        }
    }
1355638
private Pair<PlotItem, VisualizationTask> key(PlotItem item, VisualizationTask task) {
    return new Pair<>(item, task);
  }
473418
public int addTask(Task task, Object remoteTask)
    {
        if (m_taskMain == null)
        {
            if (task != null)
                if (task.isMainTaskCandidate())
                    m_taskMain = task;
        }
        m_mapTasks.put(task, (RemoteTask)remoteTask);
        return m_mapTasks.size();
    }
326518
public ItemRequest<Task> dependents(String task) {
    
        String path = String.format("/tasks/%s/dependents", task);
        return new ItemRequest<Task>(this, Task.class, path, "GET");
    }
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);
}
951769
@Override
  public Object processTask(String taskName, Map<String, String[]> parameterMap) {

    if ("createAdmin".equalsIgnoreCase(taskName)) {
      return userService.createDefaultAdmin();
    }

    return null;

  }
396406
def CreateTasksFilter(pc, tasks):
    
    if not tasks:
        return None

    # First create the object specification as the task object.
    objspecs = [vmodl.query.PropertyCollector.ObjectSpec(obj=task)
                for task in tasks]

    # Next, create the property specification as the state.
    propspec = vmodl.query.PropertyCollector.PropertySpec(
        type=vim.Task, pathSet=[], all=True)

    # Create a filter spec with the specified object and property spec.
    filterspec = vmodl.query.PropertyCollector.FilterSpec()
    filterspec.objectSet = objspecs
    filterspec.propSet = [propspec]

    # Create the filter
    return pc.CreateFilter(filterspec, True)
520957
protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) {
        return new ClusteredFutureTask<T>(runnable, value);
    }
589805
public Rule BulletList() {
        if (ext(TASKLISTITEMS)) {
            // #185 GFM style task list items [ ] open task, [x] closed task handlings
            SuperNodeTaskItemCreator itemNodeCreator = new SuperNodeTaskItemCreator() {
                public SuperNode create(Node child) {
                    return new ListItemNode(child);
                }

                public SuperNode create(Node child, int taskType, String taskListMarker) {
                    return taskType == 0 ? new ListItemNode(child) : new TaskListNode(child, taskType == 2, taskListMarker);
                }
            };
            return NodeSequence(
                    TaskListItem(Bullet(), itemNodeCreator), push(new BulletListNode(popAsNode())),
                    ZeroOrMore(
                            //vsch: this one will absorb all blank lines but the last one preceding a list item otherwise two blank lines end a list and start a new one
                            ZeroOrMore(Test(BlankLine(), BlankLine()), BlankLine()),
                            TaskListItem(Bullet(), itemNodeCreator), addAsChild()
                    )
            );
        } else {
            SuperNodeCreator itemNodeCreator = new SuperNodeCreator() {
                public SuperNode create(Node child) {
                    return new ListItemNode(child);
                }
            };
            return NodeSequence(
                    ListItem(Bullet(), itemNodeCreator), push(new BulletListNode(popAsNode())),
                    ZeroOrMore(
                            //vsch: this one will absorb all blank lines but the last one preceding a list item otherwise two blank lines end a list and start a new one
                            ZeroOrMore(Test(BlankLine(), BlankLine()), BlankLine()),
                            ListItem(Bullet(), itemNodeCreator), addAsChild()
                    )
            );
        }
    }
109078
public <F> Task<F> map(Function<E, F> mapper) {
    return new Task<>(taskId, mapper.apply(payload));
  }
580758
private ProjectCalendar getTaskCalendar(Project.Tasks.Task task)
   {
      ProjectCalendar calendar = null;

      BigInteger calendarID = task.getCalendarUID();
      if (calendarID != null)
      {
         calendar = m_projectFile.getCalendarByUniqueID(Integer.valueOf(calendarID.intValue()));
      }

      return (calendar);
   }
906076
public Element getContainer(PlotItem item, VisualizationTask task) {
    Pair<Element, Visualization> pair = map.get(key(item, task));
    return pair == null ? null : pair.first;
  }
492760
function Task(task) {
  _.extend(this, task);
  if (task != undefined) this.createId();

  // Short id
  this.__defineGetter__('id', function () {
    return this.__uuid__.substr(0, 8).toString();
  });

  // Keyword
  this.__defineGetter__('keyword', function () {
    return this.labels[0].replace('#', '').toUpperCase();
  });

  // Stemmed
  this.__defineGetter__('stemmed', function () {
    return (this.title+' '+this.body).toLowerCase()
      .split(' ').map(stem).join(' ');
  });

  // All
  this.__defineGetter__('all', function () {
    return '*';
  });
}
725240
public static JavacTrees instance(JavaCompiler.CompilationTask task) {
        if (!(task instanceof BasicJavacTask))
            throw new IllegalArgumentException();
        return instance(((BasicJavacTask)task).getContext());
    }