List tasks or provide help for specific task
        :param taskname: if supplied, help for this specific task is displayed.
            Otherwise, displays overview of available tasks.
        :return: None
554533
def help(self, taskname=None):
        

        if not taskname:
            print(inspect.getdoc(self._tasks))
            print()
            print('Available tasks:')
            print()

            for task in self.get_tasks():
                self.print_task_help(task[1], task[0])
        else:
            try:
                task = self.get_task(taskname)
                self.print_task_help(task, task.__name__)

            except TaskNotFound:
                print('Task "%s" not found! Use "ape help" to get usage information.' % taskname)
847987
def task_log(self):
        
        if self.task_id is None:
            raise ValueError('task_id is None')
        return self.get_task_log(self.task_id, self.session, self.request_kwargs)
368822
def load_tasks(self, command='all'):
        

        results = dict(
            (db, self._get_task_objects('status:%s' % db, 'export'))
            for db in Command.files(command)
        )

        # 'waiting' tasks are returned separately from 'pending' tasks
        # Here we merge the waiting list back into the pending list.
        if 'pending' in results:
            results['pending'].extend(
                self._get_task_objects('status:waiting', 'export'))

        return results
152348
def task_detail(job_id=None, task_name=None):
    
    jobs = get_jobs()
    job = [job for job in jobs if str(job['job_id']) == job_id][0]
    return render_template('task_detail.html',
                           job=job,
                           task_name=task_name,
                           task=[task for task in job['tasks']
                                 if task['name'] == task_name][0])
1315903
def task_list(self, pending=True):
        
        log = self._params.get('log', self._discard)
        tasks = [t for t in self._tasks if t.participant()]
        requires = {}
        for t in tasks:
            requires[t] = t.get_requires(pending=pending)
        done = set()
        start_order = []
        cycle = 0
        while len(tasks) > len(start_order):
            cycle += 1
            changed = False
            for t in tasks:
                if t._name in done:
                    continue
                needs = 0
                for req in requires[t]:
                    if req._name in done:
                        needs += 1
                if needs == len(requires[t]):
                    changed = True
                    start_order.append(t)
                    done.add(t._name)
                    log.debug("Found '%s' in scope", t._name)
            if not changed:
                log.error("Cycle %d failed after %s", cycle, [t._name for t in set(tasks).difference(done)])
                raise TaskError(None, "At cycle %d, startup order conflict, processed %s, remaining %s" %
                            (cycle, done, [t._name for t in set(tasks).difference(done)]))
        log.debug("Cycle %d gave %s", cycle, [t._name for t in start_order])
        return start_order
1144368
def tasks(self):
        
        task_input = {'taskName': 'QueryTaskCatalog'}
        output = taskengine.execute(task_input, self._engine_name, cwd=self._cwd)
        return output['outputParameters']['TASKS']
727787
def get_task_detail(self, task_name):
        
        def _get_detail():
            from ..compat import json  # fix object_pairs_hook parameter for Py2.6

            params = {'instancedetail': '',
                      'taskname': task_name}

            resp = self._client.get(self.resource(), params=params)
            return json.loads(resp.text if six.PY3 else resp.content,
                              object_pairs_hook=OrderedDict)

        result = _get_detail()
        if not result:
            # todo: this is a workaround for the bug that get_task_detail returns nothing.
            self.get_task_detail2(task_name)
            return _get_detail()
        else:
            return result
461770
def get_task_cls(cls, name):
        
        task_cls = cls._get_reg().get(name)
        if not task_cls:
            raise TaskClassNotFoundException(cls._missing_task_msg(name))

        if task_cls == cls.AMBIGUOUS_CLASS:
            raise TaskClassAmbigiousException('Task %r is ambiguous' % name)
        return task_cls
938711
def task(self, task_name):
        
        return Task(uri=':'.join((self._engine_name, task_name)), cwd=self._cwd)
1338838
public function listAction()
    {
        $arg = $this->request->get('args');
        $tasks = $this->taskProcessor->find($arg);

        $length = 0;
        foreach ($tasks as $t) $length = $length < strlen($t->getName()) ? strlen($t->getName()) : $length;

        foreach ($tasks as $task) {
            $this->send('%s        %s', str_pad($task->getName(), $length), $task->getShortDescription());
        }
    }
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)
1370757
def task_actions(self):
        
        if self._task_actions is None:
            self._task_actions = TaskActionsList(
                self._version,
                assistant_sid=self._solution['assistant_sid'],
                task_sid=self._solution['sid'],
            )
        return self._task_actions
350835
def get_task_quota(self, task_name):
        
        params = OrderedDict([('instancequota', ''), ('taskname', task_name)])
        resp = self._client.get(self.resource(), params=params)
        return json.loads(resp.text)
411061
def get_task_subtasks(self, task_id, completed=False):
        '''  '''
        return subtasks_endpoint.get_task_subtasks(self, task_id, completed=completed)
781592
def tasks():
    ''''''
    tasks = get_tasks()
    longest = max(tasks.keys(), key=len)
    size = len(longest)
    for name, queue in sorted(tasks.items()):
        print('* {0}: {1}'.format(name.ljust(size), queue))
14339
def task(self, task_uuid):
        
        request = clearly_pb2.FindTaskRequest(task_uuid=task_uuid)
        task = self._stub.find_task(request)
        if task.uuid:
            ClearlyClient._display_task(task, True, True, True)
        else:
            print(EMPTY)
910102
def task(self, name_or_class: Any) -> Task:
        ''''''

        if name_or_class in self.all_tasks:
            return self.all_tasks[name_or_class]

        try:
            return self.all_tasks.get(name_or_class.__class__.__name__, None)

        except AttributeError:
            return None