Create the tasks defined by this task library.
183222
def define
      fail "Version required (or :noversion)" if @version.nil?
      @version = nil if :noversion == @version

      desc "Build all the packages"
      task :package

      desc "Force a rebuild of the package files"
      task repackage: [:clobber_package, :package]

      desc "Remove package products"
      task :clobber_package do
        rm_r package_dir rescue nil
      end

      task clobber: [:clobber_package]

      [
        [need_tar, tgz_file, "z"],
        [need_tar_gz, tar_gz_file, "z"],
        [need_tar_bz2, tar_bz2_file, "j"],
        [need_tar_xz, tar_xz_file, "J"]
      ].each do |need, file, flag|
        if need
          task package: ["#{package_dir}/#{file}"]
          file "#{package_dir}/#{file}" =>
            [package_dir_path] + package_files do
            chdir(package_dir) { sh @tar_command, "#{flag}cvf", file, package_name }
          end
        end
      end

      if need_zip
        task package: ["#{package_dir}/#{zip_file}"]
        file "#{package_dir}/#{zip_file}" =>
          [package_dir_path] + package_files do
          chdir(package_dir) { sh @zip_command, "-r", zip_file, package_name }
        end
      end

      directory package_dir_path => @package_files do
        @package_files.each do |fn|
          f = File.join(package_dir_path, fn)
          fdir = File.dirname(f)
          mkdir_p(fdir) unless File.exist?(fdir)
          if File.directory?(fn)
            mkdir_p(f)
          else
            rm_f f
            safe_ln(fn, f)
          end
        end
      end
      self
    end
268195
def add_task(self, subject, status, **attrs):
        
        return Tasks(self.requester).create(
            self.project, subject, status,
            user_story=self.id, **attrs
        )
696184
def instantiate_tasks(self):
        
        self.tasks_instances = {}
        for task_name, task_class in self.tasks_classes.items():
            try:
                self.tasks_instances[task_name] = task_class()
            except Exception as ex:
                if not self.configuration[Configuration.ALGORITHM][Configuration.IOSF]:
                    raise GOSTaskException("An exception happened during the task instantiation."
                                           "{exception}".format(exception=ex))
534325
function createNewTask(task) {
        console.log("Creating task...");

        //set up the new list item
        const listItem = document.createElement("li");
        const checkBox = document.createElement("input");
        const label = document.createElement("label");


        //pull the inputed text into label
        label.innerText = task;

        //add properties
        checkBox.type = "checkbox";

        //add items to the li
        listItem.appendChild(checkBox);
        listItem.appendChild(label);
        //everything put together
        return listItem;
    }
967139
def create_tasks_dict(self, ast):
        '''
        
        '''
        tasks = self.find_asts(ast, 'Task')
        for task in tasks:
            self.parse_task(task)
        return self.tasks_dictionary
626017
def create(filename, task, alias):
    """"""

    metadata = ET.Element('metadata', {'xml:lang': 'en'})
    tool = ET.SubElement(metadata, 'tool', name=task.name,
                         displayname=task.display_name,
                         toolboxalias=alias)

    summary = ET.SubElement(tool, 'summary')
    summary.text = ''.join((HTML_BEGIN, task.description, HTML_END))

    parameters = ET.SubElement(tool, 'parameters')
    for task_param in task.parameters:
        param = ET.SubElement(parameters, 'param',
                              name=task_param['name'],
                              displayname=task_param['display_name']
                             )
        dialog_ref = ET.SubElement(param, 'dialogReference')
        dialog_ref.text = ''.join((HTML_BEGIN, task_param['description'], HTML_END))
        python_ref = ET.SubElement(param, 'pythonReference')
        python_ref.text = ''.join((HTML_BEGIN, task_param['description'], HTML_END))

    dataIdInfo = ET.SubElement(metadata, 'dataIdInfo')
    searchKeys = ET.SubElement(dataIdInfo, 'searchKeys')
    keyword1 = ET.SubElement(searchKeys, 'keyword')
    keyword1.text = 'ENVI'
    keyword2 = ET.SubElement(searchKeys, 'keyword')
    keyword2.text = task.name
    idCitation = ET.SubElement(dataIdInfo, 'idCitation')
    resTitle = ET.SubElement(idCitation, 'resTitle')
    resTitle.text = task.name
    idAbs = ET.SubElement(dataIdInfo, 'idAbs')
    idAbs.text = ''.join((HTML_BEGIN, task.description, HTML_END))
    idCredit = ET.SubElement(dataIdInfo, 'idCredit')
    idCredit.text = '(c) 2017 Exelis Visual Information Solutions, Inc.'
    resTitle.text = task.name
    tree = ET.ElementTree(metadata)
    tree.write(filename)
871180
def add(self, *tasks):
        
        nodes = [x.node for x in tasks]
        self.node.add(*nodes)
        return self
361400
public function init()
    {
        $this->newProject = new Project();
        $tdf = $this->project->getTaskDefinitions();
        $this->newProject->addTaskDefinition("property", $tdf["property"]);
    }
454678
def task(*args, **kwargs):
	''' '''

	# support @task
	if args and hasattr(args[0], '__call__'):
		return _taskify(args[0])

	# as well as @task(), @task('default'), etc.
	else:
		def wrapper(func):
			global DEFAULT, SETUP, TEARDOWN
			func = _taskify(func)

			if 'default' in args:
				DEFAULT = func

			if 'setup' in args:
				SETUP = func

			if 'teardown' in args:
				TEARDOWN = func

			if 'private' in args:
				TASKS.remove(func)

			if 'method' in args:
				func.method = True
				func.args = func.args[1:]

			if 'consume' in args:
				func.consume = True

			if 'reqs' in kwargs:
				func.reqs = _tuplify(kwargs['reqs'])
				func.file_reqs = [req for req in func.reqs if type(req) is str]
				func.task_reqs = [req for req in func.reqs if type(req) is not str]

			if 'gens' in kwargs:
				func.gens = kwargs['gens']
				GENERATES[kwargs['gens']] = func

			if 'alias' in kwargs:
				func.aliases = _tuplify(kwargs['alias'])

			if 'namespace' in kwargs:
				func.ns = kwargs['namespace'] + '.' if kwargs['namespace'] else ''

			return func

		return wrapper
818362
def _setup_task(self, load):
        

        if not self._task:
            self._task = Task(self._data_dir)

        if load:
            self._task.load()
620110
def load_tasks(self, cmd, params, args):
        """"""
        return generate_tasks('taskname that shows up in log', self._gen_tasks()), self.DOIT_CONFIG
1014348
def make_task(name='',
              run_name='',
              **kwargs) -> Task:
  """"""
  ncluster_globals.task_launched = True

  name = ncluster_globals.auto_assign_task_name_if_needed(name)

  # tmux can't use . for session names
  tmux_session = name.replace('.', '=')
  tmux_window_id = 0
  util.log(f'killing session {tmux_session}')

  if not util.is_set("NCLUSTER_NOKILL_TMUX"):
    os.system(f'tmux kill-session -t {tmux_session}')
  os.system(f'tmux new-session -s {tmux_session} -n {tmux_window_id} -d')

  task = Task(name,
              tmux_session=tmux_session,  # propagate optional args
              run_name=run_name,
              **kwargs)
  ncluster_globals.register_task(task, run_name)
  return task
70954
def asset_create_task(self, *args, **kwargs):
        
        if not self.cur_asset:
            return
        task = self.create_task(element=self.cur_asset)
        if task:
            taskdata = djitemdata.TaskItemData(task)
            treemodel.TreeItem(taskdata, self.asset_task_model.root)
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 '*';
  });
}
316532
public TaskInfo createTask(ManagedObject obj, String taskTypeId, String initiatedBy, boolean cancelable) throws RuntimeFault, RemoteException {
        return createTask(obj, taskTypeId, initiatedBy, cancelable, null);
    }
173438
private void createAndExecuteTasks(Executor executor, ProcedureFactory<BT> procedureFactory, T[] array)
    {
        this.procedures = new ArrayProcedureFJTask[this.taskCount];
        int sectionSize = array.length / this.taskCount;
        int size = this.taskCount;
        for (int index = 0; index < size; index++)
        {
            ArrayProcedureFJTask<T, BT> procedureFJTask = new ArrayProcedureFJTask<T, BT>(this, procedureFactory, array, index,
                    sectionSize, index == this.taskCount - 1);
            this.procedures[index] = procedureFJTask;
            executor.execute(procedureFJTask);
        }
    }
1358424
def setup_tasks(self, tasks):
        
        task_classes = []
        for task in tasks:
            category, namespace, name = task.split(".")
            try:
                cls = find_in_registry(category=category, namespace=namespace, name=name)[0]
            except TypeError:
                log.error("Could not find the task with category.namespace.name {0}".format(task))
                raise TypeError
            task_classes.append(cls)
        self.tasks = task_classes