Indicates if we have posts to process
504700
public function have_pages() {
		$this->setup();

		$offset = $this->get_query_offset();

		return (bool) ( $offset < $this->total_posts );
	}
735931
boolean hasOutput() {
        if (pending == null) {
            return false;
        }

        if (pending.isEmpty()) {
            return false;
        }

        if (!pending.get(0).hasRemaining()) {
            return false;
        }
        return true;
    }
1060787
def check_for_valid_postback_actions(self, required_keys, post_params):
        
        for key in required_keys:
            if key not in post_params:
                return False
        return True
1090642
def is_done(self, submissionid_or_submission, user_check=True):
        
        # TODO: not a very nice way to avoid too many database call. Should be refactored.
        if isinstance(submissionid_or_submission, dict):
            submission = submissionid_or_submission
        else:
            submission = self.get_submission(submissionid_or_submission, False)
        if user_check and not self.user_is_submission_owner(submission):
            return None
        return submission["status"] == "done" or submission["status"] == "error"
743612
private void checkDependencies() {
    if (basedOnResult != null) {
      if (!input.isComplete() || !algs.isComplete() || basedOnResult.get() != algs.getAlgorithmStep().getResult()) {
        // We've become invalidated, notify.
        basedOnResult = null;
        firePanelUpdated();
      }
    }
  }
542587
public function has_submissions_or_grades() {
        $allgrades = $this->count_grades();
        $allsubmissions = $this->count_submissions();
        if (($allgrades == 0) && ($allsubmissions == 0)) {
            return false;
        }
        return true;
    }
1201465
public boolean hasNext() {
        // check if we already fetched next item
        if (next != null) {
            return true;
        }

        // check if result set already finished
        if (resultSetFinished) {
            return false;
        }

        // now fetch next item
        next = safeReadNext();

        // check if we got something
        if (next != null) {
            return true;
        }

        // no more items
        resultSetFinished = true;

        return false;
    }
421889
def verify_submit(self, job_ids, timeout, delay, **kwargs):
        """"""
        if self.skip:
            return False

        jobs = self.wait_for_jobs(job_ids, timeout, delay)
        self.get_logs(jobs, log_file=kwargs.get("log_file"))

        return self._check_outcome(jobs)
1045874
protected function process_post_data($posts) {
        $discussionids = [];
        $forumids = [];
        $courseids = [];

        $this->log_start("Processing post information");

        $start = microtime(true);
        foreach ($posts as $id => $post) {
            $discussionids[$post->discussion] = true;
            $forumids[$post->forum] = true;
            $courseids[$post->course] = true;
            $this->add_data_for_post($post);
            $this->posts[$id] = $post;
        }
        $this->log_finish(sprintf("Processed %s posts", count($this->posts)));

        if (empty($this->posts)) {
            $this->log("No posts found. Returning early.");
            return;
        }

        // Please note, this order is intentional.
        // The forum cache makes use of the course.
        $this->log_start("Filling caches");

        $start = microtime(true);
        $this->log_start("Filling course cache", 1);
        $this->fill_course_cache(array_keys($courseids));
        $this->log_finish("Done", 1);

        $this->log_start("Filling forum cache", 1);
        $this->fill_forum_cache(array_keys($forumids));
        $this->log_finish("Done", 1);

        $this->log_start("Filling discussion cache", 1);
        $this->fill_discussion_cache(array_keys($discussionids));
        $this->log_finish("Done", 1);

        $this->log_start("Filling user subscription cache", 1);
        $this->fill_user_subscription_cache();
        $this->log_finish("Done", 1);

        $this->log_start("Filling digest cache", 1);
        $this->fill_digest_cache();
        $this->log_finish("Done", 1);

        $this->log_finish("All caches filled");

        $this->log_start("Queueing user tasks.");
        $this->queue_user_tasks();
        $this->log_finish("All tasks queued.");
    }
1025905
public function process()
    {
        if (
            $this->getForm()->getHiddenField($this->id . '_submitted') === null
        ) {
            return;
        }

        parent::process();

        foreach ($this->values as $option_value) {
            $this->getEntryWidget($option_value)->process();
        }
    }
1252307
def process_submitters(self):
        """"""
        for submission in self.submissions.values():
            if submission.author and (self.distinguished or
                                      submission.distinguished is None):
                self.submitters[submission.author].append(submission)
754530
def check_announcements():
    """"""
    res = requests.get("https://cs50.me/status/submit50")  # TODO change this to submit50.io!
    if res.status_code == 200 and res.text.strip():
        raise Error(res.text.strip())
1193650
public function check() : void {
        $processesInfo = $this->getProcessesInfo();

        foreach($this->processes as $process) {
            foreach($processesInfo as $processInfo) {
                if( Str::startsWith($processInfo->getCommand(), $process->getCommand()) ) {
                    $process->setInfo($processInfo);
                    break 2;
                }
            }
        }

        $this->checked = true;
    }
608038
def on_about_to_process(self, plugin, instance):
        """"""

        if instance is None:
            instance_item = self.data["models"]["item"].instances[0]
        else:
            instance_item = self.data["models"]["item"].instances[instance.id]

        plugin_item = self.data["models"]["item"].plugins[plugin.id]

        for section in self.data["models"]["item"].sections:
            if section.name == plugin_item.verb:
                section.isProcessing = True
            if section.name == instance_item.category:
                section.isProcessing = True

        instance_item.isProcessing = True
        plugin_item.isProcessing = True
260337
public synchronized void post()
   {
    if (tc.isEntryEnabled()) SibTr.entry(tc, "post", ""+count);
      --count;
      if (count >= 0)
         notify();
    if (tc.isEntryEnabled()) SibTr.exit(tc, "post");
   }
709679
public function process()
    {
        parent::process();

        if (
            $this->getForm()->getHiddenField($this->id . '_submitted') === null
        ) {
            return;
        }

        $data = &$this->getForm()->getFormData();
        $this->value = array_key_exists($this->id, $data);
    }
788771
def posts_count(self):
        
        return self.obj.direct_posts_count + sum(n.posts_count for n in self.children)