create TedTask for createBatch (with required params only)
193859
public static TedTask newTedTask(String taskName, String data, String key1, String key2) {
		return new TedTask(null, taskName, key1, key2, data);
	}
1250424
function taskProcessor(params, isTX) {

            if (typeof params.cb !== 'function') {
                return $p.reject(new TypeError('Callback function is required.'));
            }

            if (params.options.reusable) {
                return config.$npm.task.callback(obj.ctx, obj, params.cb, config);
            }

            const taskCtx = ctx.clone(); // task context object;
            if (isTX) {
                taskCtx.txLevel = taskCtx.txLevel >= 0 ? (taskCtx.txLevel + 1) : 0;
            }
            taskCtx.inTransaction = taskCtx.txLevel >= 0;
            taskCtx.level = taskCtx.level >= 0 ? (taskCtx.level + 1) : 0;
            taskCtx.cb = params.cb; // callback function;
            taskCtx.mode = params.options.mode; // transaction mode;
            if (this !== obj) {
                taskCtx.context = this; // calling context object;
            }

            const tsk = new config.$npm.task.Task(taskCtx, params.options.tag, isTX, config);
            taskCtx.taskCtx = tsk.ctx;
            extend(taskCtx, tsk);

            if (taskCtx.db) {
                // reuse existing connection;
                npm.utils.addReadProp(tsk.ctx, 'useCount', taskCtx.db.useCount);
                return config.$npm.task.execute(taskCtx, tsk, isTX, config);
            }

            // connection required;
            return config.$npm.connect.pool(taskCtx, dbThis)
                .then(db => {
                    taskCtx.connect(db);
                    npm.utils.addReadProp(tsk.ctx, 'useCount', db.useCount);
                    return config.$npm.task.execute(taskCtx, tsk, isTX, config);
                })
                .then(data => {
                    taskCtx.disconnect();
                    return data;
                })
                .catch(error => {
                    taskCtx.disconnect();
                    return $p.reject(error);
                });
        }
1197006
function utilTask( methodCallback, methodType, methodSchema ) {
        function tackTask( opt, success ) {
            var async;

            success = success || Noop;
            
            if ( opt.async ) {
                async = opt.async;
                delete opt.async;
            }

            if ( async ) {
                nextTick( nextTickTask, methodCallback, this, opt, success, methodType );
            }
            else {
                nextTickTask( methodCallback, this, opt, success, methodType );
            }

            return this;
        }

        Object.defineProperty( tackTask, 'task', { value: methodSchema || true });
        Object.defineProperty( tackTask, 'callback', { value: methodCallback });

        return tackTask;
    }
1162378
def batch!(operations, request_options = {})
      res = batch(operations, request_options)
      res['taskID'].each do |index, taskID|
        wait_task(index, taskID, WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY, request_options)
      end
    end
1193784
def shot_create_task(self, *args, **kwargs):
        
        if not self.cur_shot:
            return
        task = self.create_task(element=self.cur_shot)
        if task:
            taskdata = djitemdata.TaskItemData(task)
            treemodel.TreeItem(taskdata, self.shot_task_model.root)
906430
function prepareTasks (allTasks, support) {
    const tasks = {before: {}, after: {}};
    let i;

    for (i = allTasks.length - 1; i >= 0; i--) {
        const task = allTasks[i];

        //browser compatibility
        if (!needFix(support, task, 'forBrowsersLowerThan')) {
            continue;
        }

        if (!needFix(support, task, 'forBrowsersUpperOrEqualTo')) {
            continue;
        }

        //Get type and name
        let types, names;

        if (typeof task.filter === 'string') {
            types = [task.filter];
            names = ['_'];
        } else {
            types = (task.filter.type instanceof Array ? task.filter.type : (task.filter.type ? [task.filter.type] : ['_']));
            names = (task.filter.name instanceof Array ? task.filter.name : (task.filter.name ? [task.filter.name] : ['_']));
        }

        types.forEach(function (type) {
            if (!tasks[task.position].hasOwnProperty(type)) {
                tasks[task.position][type] = {};
            }

            names.forEach(function (name) {
                if (!tasks[task.position][type].hasOwnProperty(name)) {
                    tasks[task.position][type][name] = [];
                }

                tasks[task.position][type][name].push(task);
            });
        });
    }

    return tasks;
}
771867
def add(self, arg, options=None):
    
    fut = tasklets.Future('%s.add(%s, %s)' % (self, arg, options))
    todo = self._queues.get(options)
    if todo is None:
      utils.logging_debug('AutoBatcher(%s): creating new queue for %r',
                          self._todo_tasklet.__name__, options)
      if not self._queues:
        eventloop.add_idle(self._on_idle)
      todo = self._queues[options] = []
    todo.append((fut, arg))
    if len(todo) >= self._limit:
      del self._queues[options]
      self.run_queue(options, todo)
    return fut
335138
function generateTaskList (user) {
		
		var text = '';
		
		for (var t = 0; t < user.tasks.length; t++) {
			text = text + '> `' + (t + 1) + '`) ' + user.tasks[t] + '\n';
		}
		
		return text;
		
	}
276356
public int createTask(TaskCreate task, boolean silent, boolean hook) {
		TaskCreateResponse response = getResourceFactory()
				.getApiResource("/task/")
				.queryParam("silent", silent ? "1" : "0")
				.queryParam("hook", hook ? "1" : "0")
				.entity(task, MediaType.APPLICATION_JSON_TYPE)
				.post(TaskCreateResponse.class);

		return response.getId();
	}
861629
def task(func):
    
    def task_wrapper(*args, **kwargs):
        return spawn(func, *args, **kwargs)
    return task_wrapper
1309800
function(tasksConfig) {
  _setupVersioningTasks();
  _setupLazyPluginLoadingTasks();
  _setupCssTasks();
  _setupTemplatesTasks();
  _setupTestsTasks(tasksConfig);
  _setupScriptsTasks(tasksConfig);
  _setupUtilsTasks();
}
99844
static PatchingTask createTask(final PatchingTasks.ContentTaskDefinition definition, final PatchContentProvider provider, final IdentityPatchContext.PatchEntry context) {
        final PatchContentLoader contentLoader = provider.getLoader(definition.getTarget().getPatchId());
        final PatchingTaskDescription description = PatchingTaskDescription.create(definition, contentLoader);
        return PatchingTask.Factory.create(description, context);
    }
650251
function getTemplatesTasks(baseTask, app) {
	var tasks = [];
	var templates = getTemplates(app);

	if (templates) {
		for (index = 0; index < templates.length; ++index) {
		    tasks.push(baseTask + '.' + templates[index]);
		}
	}

	return tasks;
}
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]
564771
def create_for(self, ref_type, ref_id, attributes, silent=False, hook=True):
        
        # if not isinstance(attributes, dict):
        #    raise TypeError('Must be of type dict')
        attributes = json.dumps(attributes)
        return self.transport.POST(body=attributes,
                                   type='application/json',
                                   url='/task/%s/%s/%s' % (ref_type, ref_id,
                                                           self.get_options(silent=silent,
                                                                            hook=hook)))
1156258
async function createHttpTaskWithToken(
  project,
  location,
  queue,
  url,
  email,
  payload,
  inSeconds
) {
  // [START cloud_tasks_create_http_task_with_token]
  // Imports the Google Cloud Tasks library.
  const {v2beta3} = require('@google-cloud/tasks');

  // Instantiates a client.
  const client = new v2beta3.CloudTasksClient();

  // TODO(developer): Uncomment these lines and replace with your values.
  // const project = 'my-project-id';
  // const queue = 'my-appengine-queue';
  // const location = 'us-central1';
  // const url = 'https://<project-id>.appspot.com/log_payload'
  // const email = 'client@<project-id>.iam.gserviceaccount.com'
  // const options = {payload: 'hello'};

  // Construct the fully qualified queue name.
  const parent = client.queuePath(project, location, queue);

  const task = {
    httpRequest: {
      httpMethod: 'POST',
      url, //The full url path that the request will be sent to.
      oidcToken: {
        serviceAccountEmail: email,
      },
    },
  };

  if (payload) {
    task.httpRequest.body = Buffer.from(payload).toString('base64');
  }

  if (inSeconds) {
    task.scheduleTime = {
      seconds: inSeconds + Date.now() / 1000,
    };
  }

  const request = {
    parent: parent,
    task: task,
  };

  console.log('Sending task:');
  console.log(task);
  // Send create task request.
  const [response] = await client.createTask(request);
  const name = response.name;
  console.log(`Created task ${name}`);

  // [END cloud_tasks_create_http_task_with_token]
}
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;
  }