PUT /comments/1/unvote
552587
def unvote
      security_transgression_unless @comment.can_be_voted_on_by?(@user)

      @comment.unvote voter: @user

      respond_to do |format|
        format.html { redirect_to @thread }
        format.js { render :vote }
      end
    end
1046162
def remove_upvote
      begin
        client.delete("/cards/#{id}/membersVoted/#{me.id}")
      rescue Trello::Error => e
        fail e unless e.message =~ /has not voted/i
      end

      self
    end
540185
public function unMarkComment($msg_data_id, $user_comment_id, $index = null) {
        $args = $this->getUnMarkComment()->parameters(
            compact('msg_data_id', 'user_comment_id', 'index'))->json();
        return $args['errcode'] == 0;
    }
1307307
def undelete
      security_transgression_unless @comment.can_be_deleted_by?(@user)

      @comment.errors.add(:base, t('commontator.comment.errors.not_deleted')) \
        unless @comment.undelete_by(@user)

      respond_to do |format|
        format.html { redirect_to @thread }
        format.js { render :delete }
      end
    end
141754
def allow(self, comment, content_object, request):
        """"""
        # Tests for cookie:
        if settings.COOKIE_KEY not in request.COOKIES \
            and (settings.DISCARD_SPAM or settings.DISCARD_NO_COOKIE):
                return False
        elif settings.COOKIE_KEY not in request.COOKIES:
            comment.is_removed = True
            comment.is_public = False
            return True
        return True
86079
def lock_offline(self, comment=None):
        
        self.make_request(
            NodeCommandFailed,
            method='update',
            resource='lock_offline',
            params={'comment': comment})
219203
def refresh(self):
        
        super().refresh()
        self._html = None
        self._upvote_num = None
        self._content = None
        self._collect_num = None
        self._comment_num = None
811902
def _strip_comments(line, comments=None):
        """"""
        if comments is None:
            comments = []

        new_comments = False
        comment_start = line.find("#")
        if comment_start != -1:
            comments.append(line[comment_start + 1:].strip())
            new_comments = True
            line = line[:comment_start]

        return line, comments, new_comments
1035069
def purge(self, delta):
        
        self.db.execute([
            'DELETE FROM comments WHERE mode = 2 AND ? - created > ?;'
        ], (time.time(), delta))
        self._remove_stale()
662578
def upvote(self):
        
        data = self.get_selected_item()
        if 'likes' not in data:
            self.term.flash()
        elif getattr(data['object'], 'archived'):
            self.term.show_notification("Voting disabled for archived post", style='Error')
        elif data['likes']:
            with self.term.loader('Clearing vote'):
                data['object'].clear_vote()
            if not self.term.loader.exception:
                data['likes'] = None
        else:
            with self.term.loader('Voting'):
                data['object'].upvote()
            if not self.term.loader.exception:
                data['likes'] = True
860444
def _pop_comment(self, statements, comment_re):
        
        res = []
        match = None
        for st in statements:
            if match or not isinstance(st, ast.Comment):
                res.append(st)
                continue
            match = comment_re.match(st.text)
            if not match:
                res.append(st)
        return match, res
908322
function uncomment(editor, range, modelType) {
	const commentParts = modelComments[modelType];
	const stream = new BufferStreamReader(editor.getBuffer(), range.start, range);

	// narrow down comment range till meanful content
	stream.pos = range.start.translate([0, commentParts.before.length]);
	stream.eatWhile(isSpace);
	stream.start = stream.pos;

	// Make sure comment ends with proper token
	stream.pos = range.end.translate([0, -commentParts.after.length]);
	if (editor.getTextInBufferRange([stream.pos, range.end]) === commentParts.after) {
		while (!stream.sof()) {
			if (!isSpace(stream.backUp(1))) {
				stream.next();
				break;
			}
		}
	} else {
		stream.pos = range.end;
	}

	const start = new Range(range.start, stream.start);
	const end = new Range(stream.pos, range.end);
	const delta = {
		start: editor.getTextInBufferRange(start).length,
		end: editor.getTextInBufferRange(end).length
	};

	editor.setTextInBufferRange(end, '');
	editor.setTextInBufferRange(start, '');

	return delta;
}
777615
def get_votes_comment(self, *args, **kwargs):
        
        return bind_api(
            api=self,
            path='/comments/{commentId}/votes',
            payload_type='vote',
            payload_list=True,
            allowed_param=['commentId']
        )(*args, **kwargs)
1246547
def unvote_witness(self, witness, account=None):
        ''' 
        '''
        if not account:
            account = self.mainaccount
        try:
            self.steem_instance().disapprove_witness(witness, account=account)
        except Exception as e:
            self.msg.error_message("COULD NOT UNVOTE " 
                                    + witness + " AS WITNESS: " + e)
            return False
        else:
            return True
1075933
public function emptyTrash()
    {
        $this->loadModel('Comment.Comments');
        $this->Comments->deleteAll(['Comments.status' => 'trash', 'Comments.table_alias' => $this->_manageTable]);
        $this->Flash->success(__d('comment', 'All comments in trash were successfully removed!'));
        $this->title(__d('comment', 'Empty Trash'));
        $this->redirect($this->referer());
    }
411150
def community_post_comment_delete(self, post_id, id, **kwargs):
        ""
        api_path = "/api/v2/community/posts/{post_id}/comments/{id}.json"
        api_path = api_path.format(post_id=post_id, id=id)
        return self.call(api_path, method="DELETE", **kwargs)
966094
def upvote
      begin
        client.post("/cards/#{id}/membersVoted", {
          value: me.id
        })
      rescue Trello::Error => e
        fail e unless e.message =~ /has already voted/i
      end

      self
    end