Mark this comment as approved
164073
public function markApproved()
    {
        $this->IsSpam = false;
        $this->Moderated = true;
        $this->write();
        $this->extend('afterMarkApproved');
    }
888827
def comment_sync(self, comment):
        """"""
        self.host.update(key="comment", value=comment)
        self.host.emit("commented", comment=comment)
200818
async function ensureCommentRemoval(prNo, topic) {
  try {
    logger.debug(`Ensuring comment "${topic}" in #${prNo} is removed`);
    const comments = await getComments(prNo);
    let commentId;
    comments.forEach(comment => {
      if (comment.text.startsWith(`### ${topic}\n\n`)) {
        commentId = comment.id;
      }
    });
    if (commentId) {
      await deleteComment(prNo, commentId);
    }
  } catch (err) /* istanbul ignore next */ {
    logger.warn({ err }, 'Error ensuring comment removal');
  }
}
1094468
def mark(self, value=1):
    """"""

    self['count'] += value
    for m in self._meters:
      m.update(value)
40947
def _invalid(m, comment=INVALID_RESPONSE, out=None):
    '''
    
    '''
    return _set_status(m, status=False, comment=comment, out=out)
673490
def allow(self, comment, content_object, request):
        
        # Parent class check
        if not super(FluentCommentsModerator, self).allow(comment, content_object, request):
            return False

        # Akismet check
        if self.akismet_check:
            akismet_result = akismet_check(comment, content_object, request)
            if self.akismet_check_action == 'delete' and akismet_result in (SpamStatus.ProbableSpam, SpamStatus.DefiniteSpam):
                return False  # Akismet marked the comment as spam.
            elif self.akismet_check_action == 'auto' and akismet_result == SpamStatus.DefiniteSpam:
                return False  # Clearly spam

        return True
319664
def add_comment(self, line: str) -> None:
        ''' '''
        # the rule is like
        #
        # # comment line  --> add to last comment
        # blank line --> clears last comment
        # [ ] --> use last comment
        # parameter: --> use last comment
        # All others: clear last comment
        self._last_comment += (' ' if self._last_comment else '') + \
            line.lstrip('#').strip()
1087146
def addcomment(self, invoice_increment_id,
            comment=None, email=False, include_comment=False):
        
        if comment is None:
            comment = ""
        return bool(
            self.call(
                'sales_order_invoice.addComment',
                [invoice_increment_id, comment, email, include_comment]
            )
        )
25857
public void postComment(int id, int rating, String comment) {
        ClientResource resource = new ClientResource(Route.ADD_COMMENT.url(id));
        resource.setChallengeResponse(this.auth.toChallenge());

        Form form = new Form();
        if (id > 0)
            form.add("rating", String.valueOf(rating));
        if (comment != null && comment.length() > 0)
            form.add("comment", comment);

        resource.post(form);
    }
1053001
def _InitApiApprovalFromAff4Object(api_approval, approval_obj):
  """"""

  api_approval.id = approval_obj.urn.Basename()
  api_approval.reason = approval_obj.Get(approval_obj.Schema.REASON)
  api_approval.requestor = approval_obj.Get(approval_obj.Schema.REQUESTOR)

  # We should check the approval validity from the standpoint of the user
  # who had requested it.
  test_token = access_control.ACLToken(
      username=approval_obj.Get(approval_obj.Schema.REQUESTOR))
  try:
    approval_obj.CheckAccess(test_token)
    api_approval.is_valid = True
  except access_control.UnauthorizedAccess as e:
    api_approval.is_valid = False
    api_approval.is_valid_message = utils.SmartStr(e)

  notified_users = approval_obj.Get(approval_obj.Schema.NOTIFIED_USERS)
  if notified_users:
    api_approval.notified_users = sorted(
        u.strip() for u in notified_users.split(","))

  api_approval.email_message_id = approval_obj.Get(
      approval_obj.Schema.EMAIL_MSG_ID)

  email_cc = approval_obj.Get(approval_obj.Schema.EMAIL_CC)
  email_cc_addresses = sorted(s.strip() for s in email_cc.split(","))
  api_approval.email_cc_addresses = (
      set(email_cc_addresses) - set(api_approval.notified_users))

  api_approval.approvers = sorted(approval_obj.GetNonExpiredApprovers())

  return api_approval
1318048
def comment_sent(comment)
      users = ::User.all.select {|user| user.is_admin? || user.can_review?}
      bcc = users.map {|user| user.email}
      @comment = comment
      @who_name = comment.user.profile.name
      mail bcc: bcc, subject: 'CFP MagmaConf - New comment'
    end
269267
def editComment(self, repo_user, repo_name, comment_id, body):
        
        return self.api.makeRequest(
            ["repos", repo_user, repo_name,
             "pulls", "comments", str(comment_id)],
            method="POST",
            data=dict(body=body))
1038241
public function markComment($msg_data_id, $user_comment_id, $index = null) {
        $args = $this->getMarkComment()->parameters(
            compact('msg_data_id', 'user_comment_id', 'index'))->json();
        return $args['errcode'] == 0;
    }
1068245
async function (toApproveAmount) {

    const oThis = this
    ;

    const approveRsp = await simpleToken.approve(
      stakerAddress,
      stakerPassphrase,
      openSTValueContractAddress,
      toApproveAmount,
      oThis.runInAsync
    );

    return Promise.resolve(approveRsp);

  }
1372388
def post(self, request, *args, **kwargs):
        
        return self.approve(request, *args, **kwargs)
45356
def _bulk_flag(self, request, queryset, action, done_message):
        
        n_comments = 0
        for comment in queryset:
            action(request, comment)
            n_comments += 1

        msg = ungettext('1 comment was successfully %(action)s.',
                        '%(count)s comments were successfully %(action)s.',
                        n_comments)
        self.message_user(request, msg % {'count': n_comments, 'action': done_message(n_comments)})
644979
def post_comment(self, bugid, comment):
        ''''''
        data = {'id': bugid, "comment": comment}
        return self._post('bug/{bugid}/comment'.format(bugid=bugid), json.dumps(data))