Returns a ordered dictionary mapping the task status to
        the list of named tuples (task, work_index, task_index).
513235
def groupby_status(self):
        
        Entry = collections.namedtuple("Entry", "task wi ti")
        d = collections.defaultdict(list)

        for task, wi, ti in self.iflat_tasks_wti():
            d[task.status].append(Entry(task, wi, ti))

        # Sort keys according to their status.
        return OrderedDict([(k, d[k]) for k in sorted(list(d.keys()))])
1144368
def tasks(self):
        
        task_input = {'taskName': 'QueryTaskCatalog'}
        output = taskengine.execute(task_input, self._engine_name, cwd=self._cwd)
        return output['outputParameters']['TASKS']
278867
def get_task_summary(self, task_name):
        

        params = {'instancesummary': '', 'taskname': task_name}
        resp = self._client.get(self.resource(), params=params)

        map_reduce = resp.json().get('Instance')
        if map_reduce:
            json_summary = map_reduce.get('JsonSummary')
            if json_summary:
                summary = Instance.TaskSummary(json.loads(json_summary))
                summary.summary_text = map_reduce.get('Summary')
                summary.json_summary = json_summary

                return summary
1043090
@Override
  public Map<JobId, TaskStatus> getTaskStatuses() {
    final Map<JobId, TaskStatus> statuses = Maps.newHashMap();
    for (final Map.Entry<String, byte[]> entry : this.taskStatuses.entrySet()) {
      try {
        final JobId id = JobId.fromString(entry.getKey());
        final TaskStatus status = Json.read(entry.getValue(), TaskStatus.class);
        statuses.put(id, status);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    return statuses;
  }
883442
def next(self, task):
        
        uuid = str(task.uuid)
        for idx, otask in enumerate(self.tasks[:-1]):
            if otask.uuid == uuid:
                if self.tasks[idx + 1].status != 'SUCCESS':
                    return self.tasks[idx + 1]
                else:
                    uuid = self.tasks[idx + 1].uuid
1051688
def todo_tasks(self):
        """"""
        tasks = [task for task in self.all_tasks if task._state == NewTask._PENDING]
        return tasks
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)
866833
def done_tasks(self):
        """"""
        tasks = [task for task in self.all_tasks if task._state != NewTask._PENDING]
        return tasks
478303
def getTaskHelp(_Task):
  
  """
  Ret = []

  for k in ['name', 'desc']:
    v = _Task.Config.get(k)

    if v is not None:
      Ret.append('%s: %s' % (k, v))

  Args = _Task.Args

  if Args:
    Ret.append('\nArgs:')

    for argName, Arg in Args.items():
      Ret.append('  %s: %s' % (argName, Arg.get('desc', Arg['type_str'])))

    Ret.append('')

  return '\n'.join(Ret).rstrip()
404720
def iteritems_sorted(dict_):
    
    if isinstance(dict_, OrderedDict):
        return six.iteritems(dict_)
    else:
        return iter(sorted(six.iteritems(dict_)))
352195
def get(self):
        
        return TaskStatisticsContext(
            self._version,
            assistant_sid=self._solution['assistant_sid'],
            task_sid=self._solution['task_sid'],
        )
53979
def get_task_subtasks(client, task_id, completed=False):
    '''  '''
    params = {
            'task_id' : int(task_id),
            'completed' : completed,
            }
    response = client.authenticated_request(client.api.Endpoints.SUBTASKS, params=params)
    return response.json()
790451
def _populate_unknown_statuses(set_tasks):
    
    visited = set()
    for task in set_tasks["still_pending_not_ext"]:
        _depth_first_search(set_tasks, task, visited)
409621
def get_all_status(self, only_min=False):
        
        if len(self) == 0:
            # The work will be created in the future.
            if only_min:
                return self.S_INIT
            else:
                return [self.S_INIT]

        self.check_status()
        status_list = [task.status for task in self]

        if only_min:
            return min(status_list)
        else:
            return status_list
934692
def items(self):
        
        return {dep.task: value for dep, value in self._result.items()}.items()
114127
def serialized_task(self, task: Task) -> Tuple[str, str]:
        
        return f"{task.hash}.json", task.json
658383
def to_dict(self):
        

        task_desc_as_dict = {
            'uid': self._uid,
            'name': self._name,
            'state': self._state,
            'state_history': self._state_history,

            'pre_exec': self._pre_exec,
            'executable': self._executable,
            'arguments': self._arguments,
            'post_exec': self._post_exec,
            'cpu_reqs': self._cpu_reqs,
            'gpu_reqs': self._gpu_reqs,
            'lfs_per_process': self._lfs_per_process,

            'upload_input_data': self._upload_input_data,
            'copy_input_data': self._copy_input_data,
            'link_input_data': self._link_input_data,
            'move_input_data': self._move_input_data,
            'copy_output_data': self._copy_output_data,
            'move_output_data': self._move_output_data,
            'download_output_data': self._download_output_data,

            'stdout': self._stdout,
            'stderr': self._stderr,

            'exit_code': self._exit_code,
            'path': self._path,
            'tag': self._tag,

            'parent_stage': self._p_stage,
            'parent_pipeline': self._p_pipeline,
        }

        return task_desc_as_dict