Task instance representing 'task', if any
761920
def resolved_task(cls, task):
        """"""
        for t in cls.tasks:
            if t is task or t.execute is task:
                return t
114127
def serialized_task(self, task: Task) -> Tuple[str, str]:
        
        return f"{task.hash}.json", task.json
475450
def tasks_spec(self, available_actions, default_action="run"):
        """"""
        return dictof(
              self.task_name_spec
            , create_spec(task_objs.Task, validators.deprecated_key("spec", "Use ``action`` and ``options`` instead (note that ``action`` defaults to run)")
                , action = defaulted(string_choice_spec(available_actions, "No such task"), default_action)
                , options = dictionary_spec()
                , overrides = dictionary_spec()
                , description = string_spec()
                )
            )
918111
def task2ics():
    """"""
    from argparse import ArgumentParser, FileType
    from sys import stdout

    parser = ArgumentParser(description='Converter from Taskwarrior to iCalendar syntax.')
    parser.add_argument('indir', nargs='?', help='Input Taskwarrior directory (default to ~/.task)', default=expanduser('~/.task'))
    parser.add_argument('outfile', nargs='?', type=FileType('w'), default=stdout,
                        help='Output iCalendar file (default: stdout)')
    args = parser.parse_args()

    task = IcsTask(args.indir)
    args.outfile.write(task.to_vobject().serialize())
842958
def invoke_task(task, args):
    
    parser, proxy_args = get_task_parser(task)
    if proxy_args:
        return task(*args)
    else:
        pargs = parser.parse_args(args)
        return task(**vars(pargs))
398985
def _taskdict(task):
    '''
    
    '''
    if task is None:
        task = asyncio.current_task()

    assert task
    taskvars = getattr(task, '_syn_taskvars', None)

    if taskvars is None:
        taskvars = varinit(task)

    return taskvars
590172
def user_view_task(self, ):
        
        if not self.cur_user:
            return
        i = self.user_task_treev.currentIndex()
        item = i.internalPointer()
        if item:
            task = item.internal_data()
            if isinstance(task, djadapter.models.Task):
                self.view_task(task)
1081255
def create_task_info(task):
    """"""
    task_info = None
    if task.get('info'):
        task_info = task['info']
    else:
        task_info = task
    return task_info
279748
def seen_tasks(self, request, context):
        """"""
        _log_request(request, context)
        result = clearly_pb2.SeenTasksMessage()
        result.task_types.extend(self.listener.memory.task_types())
        return result
38889
def execute(self, env, args):
        

        task_name = args.task_name

        if task_name is None:
            if not env.task.active:
                raise errors.NoActiveTask
            task_name = env.task.name

        tasks = env.task.get_list_info(task_name)
        if not tasks:
            raise errors.TaskNotFound(task_name)

        _print_tasks(env, tasks)
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
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
532760
function(tasks, callback) {

      var keys; var length; var i; var results; var kind;
      var updated_tasks = [];
      var is_object;
      var counter = 0;

      if (isArray(tasks)) {

        length = tasks.length;
        results = [];

      } else if (isObject(tasks)) {

        is_object = true;
        keys = ObjectKeys(tasks);
        length = keys.length;
        results = {};

      } else {
        return callback();
      }

      for (i=0; i<length; i++) {

        if (is_object) {
          updated_tasks.push({ k: keys[i], t: tasks[keys[i]] });
        } else {
          updated_tasks.push({ k: i, t: tasks[i] });
        }

      }

      updated_tasks.forEach(function(task_object) {

        task_object.t(function(err, result) {
          if (err) return callback(err);

          results[task_object.k] = result;

          counter++;
          if (counter == length) callback(null, results);
        });

      });

    }
325810
def _create_result(self, cls):
        # type:(Callable)->Tuple[Any, Callable]
        
        task = instantiate(cls)
        logging.getLogger(__name__).debug("Task object {0} created [{1}].".format(cls.__name__, task))
        return task, get_callable(task)
861629
def task(func):
    
    def task_wrapper(*args, **kwargs):
        return spawn(func, *args, **kwargs)
    return task_wrapper
1230890
def get_task(self, task_id):
        
        task = self.request_single('GetTask', {'id': task_id})

        if task:
            return zobjects.Task.from_dict(task)
        else:
            return None
1142656
function(task, context, args) {
            // can used to default task
            if (!_.isFunction(task)) {
                args = task;
                task = null;
                context = null;
            }

            if (!_.isArray(args)) args = [args];

            var d = Q.defer();
            this.tasks.push({
                "task": task,
                "args": args || [],
                "context": context,
                "result": d
            });
            if (this.empty == true) {
                this.startNext();
            }
            return d.promise;
        }