Add an approving comment to the request.
760990
def approve(number)
      request = server.get_request_by_number(number)
      repo = server.source_repo
      # TODO: Make this configurable.
      comment = 'Reviewed and approved.'
      response = server.add_comment(repo, request.number, comment)
      if response[:body] == comment
        puts 'Successfully approved request.'
      else
        puts response[:message]
      end
    end
755546
public void addComment(Comment comment) {
        if (comments == null || comments.size() == 0) {
            comments = new ArrayList<Comment>();
        }

        comments.add((CommentImpl) comment);
    }
574719
public function approve($comment)
    {
        $qry = new InvokePostMethodQuery($this->getResourcePath(), "approve", array(
            "comment" => $comment
        ));
        $this->getContext()->addQuery($qry);
    }
596636
def success(request, message, extra_tags='', fail_silently=False):
    """"""
    add_message(request, constants.SUCCESS, message, extra_tags=extra_tags,
                fail_silently=fail_silently)
617284
def add_comment(self, case_obj, text, variant_id=None, username=None):
        """"""

        comment = Comment(
            text=text,
            username=username or 'Anonymous',
            case=case_obj,
            # md5 sum of chrom, pos, ref, alt
            variant_id=variant_id
        )
        self.session.add(comment)
        self.save()
        return comment
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))
472622
def allow(self, comment, content_object, request):
        """"""
        
        POST = urlencode({
                "blog": settings.AKISMET_BLOG.encode("utf-8"),
                "user_ip": comment.ip_address,
                "user_agent": request.META.get('HTTP_USER_AGENT', "").
                                                encode("utf-8"),
                "referrer": request.META.get('HTTP_REFERRER', "").
                                                encode("utf-8"),
                "comment_author": comment.user_name.encode("utf-8"),
                "comment_author_email": comment.user_email.encode("utf-8"),
                "comment_author_url": comment.user_url.encode("utf-8"),
                "comment_content": comment.comment.encode("utf-8")})
        connection = HTTPConnection(AKISMET_URL, AKISMET_PORT)
        connection.request("POST", AKISMET_PATH, POST,
                           {"User-Agent": AKISMET_USERAGENT,
                            "Content-type":"application/x-www-form-urlencoded"
                            })
        response = connection.getresponse()
        status, result = response.status, response.read()
        if result == "false":
            return True
        elif result == "true" and settings.DISCARD_SPAM:
            return False
        elif result == "true":
            comment.is_removed = True
            comment.is_public = False
            return True
        else:
            raise AkismetError(status, result)
559614
def put(self, request, bot_id, id, format=None):
              
        return super(StateDetail, self).put(request, bot_id, id, format)
716732
def add_comment(self, topic_id, content, reply_id=None):
        
        return self.api.req(API_GROUP_ADD_COMMENT % topic_id, 'post', data={
            'ck': self.api.ck(),
            'ref_cid': reply_id,
            'rv_comment': content,
            'start': 0,
            'submit_btn': '加上去',
        })
1255385
public function addComment(Request $request, $post_id)
	{
		$post = Post::find($post_id);
		$comment = new Comment();
		$comment->on_post = $post_id;
		$comment->from_user=Auth::user()->id;
		$comment->body = $request->input('body');
		
		$post->comments()->save($comment);
	
		return redirect(route('post.show', [
				'post' => $post,
				'comments' => $post->comments,
		]))->with('success', 'Comment added!');
	}
398836
protected function addReview()
    {
        $this->controlAccess('review_add');

        if ($this->review->add($this->getSubmitted())) {
            $this->redirect('admin/content/review', $this->text('Review has been added'), 'success');
        }

        $this->redirect('', $this->text('Review has not been added'), 'warning');
    }
339325
def cli(ctx, comment, metadata=""):
    
    return ctx.gi.cannedcomments.add_comment(comment, metadata=metadata)
99751
def request_comments(self, id, **kwargs):
        ""
        api_path = "/api/v2/requests/{id}/comments.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
1193908
public function addAction()
    {
        $isPosted = $this->request->getPost('doCreate');
        
        if (!$isPosted) {
            $this->response->redirect($this->request->getPost('redirect'));
        }

        $comment = [
            'content'   => $this->request->getPost('content'),
            'name'      => $this->request->getPost('name'),
            'web'       => $this->request->getPost('web'),
            'mail'      => $this->request->getPost('mail'),
            'timestamp' => time(),
            'ip'        => $this->request->getServer('REMOTE_ADDR'),
        ];

        $comments = new \Phpmvc\Comment\CommentsInSession();
        $comments->setDI($this->di);

        $comments->add($comment);

        $this->response->redirect($this->request->getPost('redirect'));
    }
420246
@RequirePOST
    public HttpResponse doApprove(@QueryParameter String value) throws IOException {
        whitelisted.append(value);
        return HttpResponses.ok();
    }
358621
def comments(case_id):
    """"""
    text = request.form['text']
    variant_id = request.form.get('variant_id')
    username = request.form.get('username')
    case_obj = app.db.case(case_id)
    app.db.add_comment(case_obj, text, variant_id=variant_id, username=username)
    return redirect(request.referrer)
893861
def Request(self):
    """"""

    approval_id = "approval:%X" % random.UInt32()
    approval_urn = self.BuildApprovalUrn(approval_id)

    email_msg_id = email.utils.make_msgid()

    with aff4.FACTORY.Create(
        approval_urn, self.approval_type, mode="w",
        token=self.token) as approval_request:
      approval_request.Set(approval_request.Schema.SUBJECT(self.subject_urn))
      approval_request.Set(
          approval_request.Schema.REQUESTOR(self.token.username))
      approval_request.Set(approval_request.Schema.REASON(self.reason))
      approval_request.Set(approval_request.Schema.EMAIL_MSG_ID(email_msg_id))

      cc_addresses = (self.email_cc_address,
                      config.CONFIG.Get("Email.approval_cc_address"))
      email_cc = ",".join(filter(None, cc_addresses))

      # When we reply with the approval we want to cc all the people to whom the
      # original approval was sent, to avoid people approving stuff that was
      # already approved.
      if email_cc:
        reply_cc = ",".join((self.approver, email_cc))
      else:
        reply_cc = self.approver

      approval_request.Set(approval_request.Schema.EMAIL_CC(reply_cc))

      approval_request.Set(
          approval_request.Schema.NOTIFIED_USERS(self.approver))

      # We add ourselves as an approver as well (The requirement is that we have
      # 2 approvers, so the requester is automatically an approver).
      approval_request.AddAttribute(
          approval_request.Schema.APPROVER(self.token.username))

    approval_link_urns = self.BuildApprovalSymlinksUrns(approval_id)
    for link_urn in approval_link_urns:
      with aff4.FACTORY.Create(
          link_urn, aff4.AFF4Symlink, mode="w", token=self.token) as link:
        link.Set(link.Schema.SYMLINK_TARGET(approval_urn))

    return approval_urn