Display the topic review if needed
3549
public function topicReview($tid)
    {
        $post_data = [];

        $post_data = Container::get('hooks')->fire('model.post.topic_review_start', $post_data, $tid);

        $select_topic_review = ['poster', 'message', 'hide_smilies', 'posted'];

        $result = DB::forTable('posts')->select_many($select_topic_review)
                    ->where('topic_id', $tid)
                    ->order_by_desc('id');
        $result = Container::get('hooks')->fire('model.post.topic_review_query', $result);
        $result = $result->find_many();

        foreach ($result as $cur_post) {
            $cur_post['message'] = Container::get('parser')->parseMessage(
                $cur_post['message'],
                $cur_post['hide_smilies']
            );
            $post_data[] = $cur_post;
        }

        $post_data = Container::get('hooks')->fire('model.post.topic_review', $post_data);

        return $post_data;
    }
824
protected function addReview()
    {
        if (!$this->isError()) {
            $id = $this->review->add($this->getSubmitted());
            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($id);
        }
    }
517385
def update
      @topic = Topic.find(params[:id])

      if @topic.update_attributes(topic_params)
        redirect_to(topic_path(@topic.id), notice: t('homeland.topic_updated'))
      else
        render action: "edit"
      end
    end
26303
def check(self, topic, value):
        
        datatype_key = topic.meta.get('datatype', 'none')
        self._datatypes[datatype_key].check(topic, value)
        validate_dt = topic.meta.get('validate', None)
        if validate_dt:
            self._datatypes[validate_dt].check(topic, value)
641750
public function display() {
        global $OUTPUT;
        groups_print_activity_menu($this->feedbackstructure->get_cm(), $this->baseurl->out());
        $grandtotal = $this->get_total_responses_count();
        if (!$grandtotal) {
            echo $OUTPUT->box(get_string('nothingtodisplay'), 'generalbox nothingtodisplay');
            return;
        }

        if (count($this->feedbackstructure->get_items(true)) > self::PREVIEWCOLUMNSLIMIT) {
            echo $OUTPUT->notification(get_string('questionslimited', 'feedback', self::PREVIEWCOLUMNSLIMIT), 'info');
        }

        $this->out($this->showall ? $grandtotal : FEEDBACK_DEFAULT_PAGE_COUNT,
                $grandtotal > FEEDBACK_DEFAULT_PAGE_COUNT);

        // Toggle 'Show all' link.
        if ($this->totalrows > FEEDBACK_DEFAULT_PAGE_COUNT) {
            if (!$this->use_pages) {
                echo html_writer::div(html_writer::link(new moodle_url($this->baseurl, [$this->showallparamname => 0]),
                        get_string('showperpage', '', FEEDBACK_DEFAULT_PAGE_COUNT)), 'showall');
            } else {
                echo html_writer::div(html_writer::link(new moodle_url($this->baseurl, [$this->showallparamname => 1]),
                        get_string('showall', '', $this->totalrows)), 'showall');
            }
        }
    }
449387
def topic_update(channel, topic_channel):
    

    if topic_channel is not None:
        try:
            channel_message = "Topic channel is now `{}`.".format(topic_channel.name)
        except Exception as e:
            logger.exception(e)
            channel_message = "Topic channel has been updated."
    else:
        channel_message = "Topic channel has been cleared."

    # Create embed UI object
    gui = ui_embed.UI(
            channel,
            "Topic channel updated",
            channel_message,
            modulename=modulename,
            colour=modulecolor_info
    )

    return gui
1079387
def review(id)
      data = request("/review/show", id: id)
      Hashie::Mash.new(data["review"])
    end
817350
def notify(self, topic, **kwargs):
        '''
        
        '''
        kwargs['name'] = self._name
        self._engine._notify(topic, **kwargs)
1280541
def query_record_useful_review(comID, value):
    
    # retrieve nb_useful votes
    query1 = """SELECT nb_votes_total, nb_votes_yes FROM "cmtRECORDCOMMENT" WHERE id=%s"""
    params1 = (comID,)
    res1 = run_sql(query1, params1)
    if len(res1) == 0:
        return 0

    # modify and insert new nb_useful votes
    nb_votes_yes = int(res1[0][1])
    if value >= 1:
        nb_votes_yes = int(res1[0][1]) + 1
    nb_votes_total = int(res1[0][0]) + 1
    query2 = """UPDATE "cmtRECORDCOMMENT" SET nb_votes_total=%s, nb_votes_yes=%s WHERE id=%s"""
    params2 = (nb_votes_total, nb_votes_yes, comID)
    res2 = run_sql(query2, params2)
    return int(res2)
185607
protected function ViewArticleHook()
    {
        $this->SetTemplate('MTShopArticleCatalog', 'system/article');

        // add review item and fill with user data
        $oReviewItem = TdbShopArticleReview::GetNewInstance();
        /** @var $oReviewItem TdbShopArticleReview */
        $oGlobal = TGlobal::instance();
        $aReviewData = array();
        if ($oGlobal->UserDataExists(TdbShopArticleReview::INPUT_BASE_NAME)) {
            $aReviewData = $oGlobal->GetUserData(TdbShopArticleReview::INPUT_BASE_NAME);
        } else {
            $oUser = TdbDataExtranetUser::GetInstance();
            if ($oUser->IsLoggedIn()) {
                $aReviewData['author_name'] = $oUser->GetUserAlias();
                $aReviewData['author_email'] = $oUser->GetUserEMail();
            }
        }
        $aReviewData['captcha-question'] = $this->GenerateCaptcha();

        if (is_array($aReviewData)) {
            $oReviewItem->LoadFromRowProtected($aReviewData);
        }
        $this->data['oReviewEntryItem'] = &$oReviewItem;
    }
229084
protected function setTitleEditReview()
    {
        if (isset($this->data_review['review_id'])) {
            $title = $this->text('Edit %name', array('%name' => $this->text('Review')));
        } else {
            $title = $this->text('Add review');
        }

        $this->setTitle($title);
    }
1021529
def _prepare_output(topics_with_wrong_rf, verbose):
    """"""
    out = {}
    topics_count = len(topics_with_wrong_rf)
    out['raw'] = {
        'topics_with_wrong_replication_factor_count': topics_count,
    }

    if topics_count == 0:
        out['message'] = 'All topics have proper replication factor.'
    else:
        out['message'] = (
            "{0} topic(s) have replication factor lower than specified min ISR + 1."
        ).format(topics_count)

        if verbose:
            lines = (
                "replication_factor={replication_factor} is lower than min_isr={min_isr} + 1 for {topic}"
                .format(
                    min_isr=topic['min_isr'],
                    topic=topic['topic'],
                    replication_factor=topic['replication_factor'],
                )
                for topic in topics_with_wrong_rf
            )
            out['verbose'] = "Topics:\n" + "\n".join(lines)
    if verbose:
        out['raw']['topics'] = topics_with_wrong_rf

    return out
301247
protected function getListReview()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        return (array) $this->review->getList($conditions);
    }
57262
async def set_review(self, **params):
		
		if params.get("message"):
			params = json.loads(params.get("message", "{}"))
		
		if not params:
			return {"error":400, "reason":"Missed required fields"}

		cid = int(params.get("cid", 0))
		txid = params.get("txid")
		coinid = params.get("coinid")

		try:
			coinid = coinid.replace("TEST", "")
		except:
			pass
		
		# Get content
		database = client[coinid]
		content_collection = database[settings.CONTENT]
		content = await content_collection.find_one({"cid":cid})
		if not content:
			return {"error":404, "reason":"Not found current content"}

		database = client[coinid]
		review_collection = database[settings.REVIEW]		
		await review_collection.insert_one({"cid":cid, "confirmed":None, 
											"txid":txid, "coinid":coinid})
		return {"result":"ok"}
1045693
def mark_topics_read(self, request, pk):
        
        track_handler.mark_forums_read([self.forum, ], request.user)
        messages.success(request, self.success_message)
        return HttpResponseRedirect(self.get_forum_url())
414277
public function listReview()
    {
        $this->actionListReview();
        $this->setTitleListReview();
        $this->setBreadcrumbListReview();
        $this->setFilterListReview();
        $this->setPagerListReview();

        $this->setData('reviews', $this->getListReview());

        $this->outputListReview();
    }
436725
def display_problem(id)
    load_problem_details(id)

    puts
    puts "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
    puts
    puts Problem[id].title.upcase
    puts "Problem #{id}"
    puts
    puts Problem[id].published
    puts Problem[id].solved_by
    puts Problem[id].difficulty if id < Problem.total - 9
    puts
    puts "https://projecteuler.net/problem=#{id}"
    puts
    puts "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
  end