Read all top level tasks.
489069
private void processTasks() throws SQLException
   {
      //
      // Yes... we could probably read this in one query in the right order
      // using a CTE... but life's too short.
      //
      List<Row> rows = getRows("select * from zscheduleitem where zproject=? and zparentactivity_ is null and z_ent=? order by zorderinparentactivity", m_projectID, m_entityMap.get("Activity"));
      for (Row row : rows)
      {
         Task task = m_project.addTask();
         populateTask(row, task);
         processChildTasks(task);
      }
   }
158752
def list_tasks(collector):
    """"""
    print("Usage: aws_syncr <environment> <task>")
    print("")
    print("Available environments to choose from are")
    print("-----------------------------------------")
    print("")
    for environment in os.listdir(collector.configuration_folder):
        location = os.path.join(collector.configuration_folder, environment)
        if os.path.isdir(location) and not environment.startswith("."):
            print("\t{0}".format(environment))

    print("")
    print("Available tasks to choose from are:")
    print("-----------------------------------")
    print("")
    keygetter = lambda item: item[1].label
    tasks = sorted(available_actions.items(), key=keygetter)
    sorted_tasks = sorted(list(tasks), key=lambda item: len(item[0]))
    max_length = max(len(name) for name, _ in sorted_tasks)
    for key, task in sorted_tasks:
        desc = dedent(task.__doc__ or "").strip().split('\n')[0]
        print("\t{0}{1} :-: {2}".format(" " * (max_length-len(key)), key, desc))
    print("")
867410
def top(self, sort_by):
        """"""
        sort = sorted(self.results, key=sort_by)
        return sort
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
553129
def examine(self):
        """"""
        if self._changes:
            return self._changes.pop()

        # clean filepath
        self.filepath = None
        delays = set([0])
        for path in self._tasks:
            item = self._tasks[path]
            if self.is_changed(path, item['ignore']):
                func = item['func']
                func and func()
                delay = item['delay']
                if delay:
                    delays.add(delay)

        if 'forever' in delays:
            delay = 'forever'
        else:
            delay = max(delays)
        return self.filepath, delay
637929
def get_all(self):
        """"""
        logger.debug('Fetching items. Path: {data_file}'.format(
            data_file=self.data_file
        ))

        return load_file(self.data_file)
428583
async def read(self):
        
        payload = await self._queue.get()
        self._queue.task_done()
        return payload
1264479
void readAll() {
        try {
            try {
                int b = input.read();
                while (b >= 0) {
                    readObject(b);
                    b = input.read();
                }
            } finally {
                input.close();
            }
        } catch (IOException ex) {
            throw new IllegalStateException(ex);
        }
    }
434231
def top_level(self):
        
        top = list(self.cell_dict.values())
        for cell in self.cell_dict.values():
            for dependency in cell.get_dependencies():
                if dependency in top:
                    top.remove(dependency)
        return top
50126
def read_all(self):
        
        log.debug("read all static memory")
        cmd = "\x00\x00\x00" + self.uid
        return self.transceive(cmd)
1136546
private void processTasks() throws IOException
   {
      TaskReader reader = new TaskReader(m_data.getTableData("Tasks"));
      reader.read();
      for (MapRow row : reader.getRows())
      {
         processTask(m_project, row);
      }
      updateDates();
   }
873792
def scan_tasks(self):
        ''''''
        def update_task_status(info, error=None):
            if error or not info:
                logger.error('CloudPage.scan_tasks: %s, %s' % (info, error))
                return
            tasks = info['task_info']
            for row in self.liststore:
                if not row or row[TASKID_COL] not in tasks:
                    continue
                task = tasks[row[TASKID_COL]]
                row[SIZE_COL] = int(task['file_size'])
                row[FINISHED_COL] = int(task['finished_size'])
                row[STATUS_COL] = int(task['status'])
                if row[SIZE_COL]:
                    row[PERCENT_COL] = int(
                            row[FINISHED_COL] / row[SIZE_COL] * 100)
                size = util.get_human_size(row[SIZE_COL])[0]
                finished_size = util.get_human_size(row[FINISHED_COL])[0]
                if row[SIZE_COL] == row[FINISHED_COL]:
                    row[HUMANSIZE_COL] = size
                else:
                    row[HUMANSIZE_COL] = '{0}/{1}'.format(finished_size, size)

        task_ids = [row[TASKID_COL] for row in self.liststore]
        if task_ids:
            gutil.async_call(pcs.cloud_query_task, self.app.cookie,
                             self.app.tokens, task_ids,
                             callback=update_task_status)
1331982
private void readLeafTasks(Task parent, Integer id)
   {
      Integer currentID = id;
      Table table = getTable("A1TAB");
      while (currentID.intValue() != 0)
      {
         if (m_projectFile.getTaskByUniqueID(currentID) == null)
         {
            readTask(parent, currentID);
         }
         currentID = table.find(currentID).getInteger("NEXT_TASK_ID");
      }
   }
1355085
def seen_tasks(self):
        """"""
        print('\n'.join(self._stub.seen_tasks(clearly_pb2.Empty()).task_types))
1054111
private void checkTasks() {
    if (currentTask == null) {
      Handler<Task> task = queue.poll();
      if (task != null) {
        currentTask = new Task(this);
        task.handle(currentTask);
      }
    }
  }
250713
private void readPredecessors(net.sf.mpxj.planner.schema.Task plannerTask)
   {
      Task mpxjTask = m_projectFile.getTaskByUniqueID(getInteger(plannerTask.getId()));

      Predecessors predecessors = plannerTask.getPredecessors();
      if (predecessors != null)
      {
         List<Predecessor> predecessorList = predecessors.getPredecessor();
         for (Predecessor predecessor : predecessorList)
         {
            Integer predecessorID = getInteger(predecessor.getPredecessorId());
            Task predecessorTask = m_projectFile.getTaskByUniqueID(predecessorID);
            if (predecessorTask != null)
            {
               Duration lag = getDuration(predecessor.getLag());
               if (lag == null)
               {
                  lag = Duration.getInstance(0, TimeUnit.HOURS);
               }
               Relation relation = mpxjTask.addPredecessor(predecessorTask, RELATIONSHIP_TYPES.get(predecessor.getType()), lag);
               m_eventManager.fireRelationReadEvent(relation);
            }
         }
      }

      //
      // Process child tasks
      //
      List<net.sf.mpxj.planner.schema.Task> childTasks = plannerTask.getTask();
      for (net.sf.mpxj.planner.schema.Task childTask : childTasks)
      {
         readPredecessors(childTask);
      }
   }
207215
def top_level(url, fix_protocol=True):
    """"""
    ext = tld.get_tld(url, fix_protocol=fix_protocol)
    toplevel = '.'.join(urlparse(url).netloc.split('.')[-2:]).split(
        ext)[0] + ext
    return toplevel