List queued tasks aggregated by name
547096
def status(queue, munin, munin_config):
    """"""
    if munin_config:
        return status_print_config(queue)
    queues = get_queues(queue)
    for queue in queues:
        status_print_queue(queue, munin=munin)
    if not munin:
        print('-' * 40)
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);
        });

      });

    }
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
1019221
def tasks(self, task_cls=None):
		
		result = []
		for tasks in self.__registry.values():
			result.extend(tasks)

		if task_cls is not None:
			result = filter(lambda x: issubclass(x, task_cls), result)
		return tuple(result)
648469
def _group_tasks_by_name_and_status(task_dict):
    
    group_status = {}
    for task in task_dict:
        if task.task_family not in group_status:
            group_status[task.task_family] = []
        group_status[task.task_family].append(task)
    return group_status
620110
def load_tasks(self, cmd, params, args):
        """"""
        return generate_tasks('taskname that shows up in log', self._gen_tasks()), self.DOIT_CONFIG
654052
def find_all_by_parameters(self, task_name, session=None, **task_params):
        
        with self._session(session) as session:
            query = session.query(TaskRecord).join(TaskEvent).filter(TaskRecord.name == task_name)
            for (k, v) in six.iteritems(task_params):
                alias = sqlalchemy.orm.aliased(TaskParameter)
                query = query.join(alias).filter(alias.name == k, alias.value == v)

            tasks = query.order_by(TaskEvent.ts)
            for task in tasks:
                # Sanity check
                assert all(k in task.parameters and v == str(task.parameters[k].value) for (k, v) in six.iteritems(task_params))

                yield task
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)
1342668
def _list_queues():
    '''
    
    '''
    queue_dir = __opts__['sqlite_queue_dir']
    files = os.path.join(queue_dir, '*.db')
    paths = glob.glob(files)
    queues = [os.path.splitext(os.path.basename(item))[0] for item in paths]

    return queues
1340617
def get_tasks():
    ''''''
    return {
        name: get_task_queue(name, cls)
        for name, cls in celery.tasks.items()
        # Exclude celery internal tasks
        if not name.startswith('celery.')
        # Exclude udata test tasks
        and not name.startswith('test-')
    }
530006
def list_tasks(self):
        
        from highton.models.task import Task

        return fields.ListField(
            name=self.ENDPOINT,
            init_class=Task
        ).decode(
            self.element_from_string(
                self._get_request(
                    endpoint=self.ENDPOINT + '/' + str(self.id) + '/' + Task.ENDPOINT,
                ).text
            )
        )
1305710
def count(self):
		
		result = 0
		for tasks in self.__registry.values():
			result += len(tasks)
		return result
982039
def tasks(self, **kwargs):
        
        tasks_result = self.service.tasks().list(**kwargs).execute()
        return [Task(task) for task in tasks_result.get("items", [])]
533089
def parent_task(name)
      task name do
        Rake::Task
          .tasks
          .select { |t| t.name =~ /^#{name}:/ }
          .sort_by(&:name)
          .each(&:execute)
      end
    end
1024461
def pending_tasks(self, res):
        ""
        jobs, lock = self._jobs
        with lock:
            return jobs[res].copy()
731071
def get_tasks(client, list_id, completed=False):
    '''  '''
    params = { 
            'list_id' : str(list_id), 
            'completed' : completed 
            }
    response = client.authenticated_request(client.api.Endpoints.TASKS, params=params)
    return response.json()
983004
def list_queues(backend='sqlite'):
    '''
    
    '''
    queue_funcs = salt.loader.queues(__opts__)
    cmd = '{0}.list_queues'.format(backend)
    if cmd not in queue_funcs:
        raise SaltInvocationError('Function "{0}" is not available'.format(cmd))
    ret = queue_funcs[cmd]()
    return ret