Add a comment to hash table before saving to disk. You can add as many
comment lines as you like. These comment lines are discarded when loading
the file. If you use a null format, all comments are deleted.
515368
def comment(self, format, *args):
        
        return lib.zhashx_comment(self._as_parameter_, format, *args)
416166
def add_comment(repo: GithubRepository, pull_id: int, text: str) -> None:
    
    url = ("https://api.github.com/repos/{}/{}/issues/{}/comments"
           "?access_token={}".format(repo.organization,
                                     repo.name,
                                     pull_id,
                                     repo.access_token))
    data = {
        'body': text
    }
    response = requests.post(url, json=data)

    if response.status_code != 201:
        raise RuntimeError('Add comment failed. Code: {}. Content: {}.'.format(
            response.status_code, response.content))
427298
def insert_spacing! lines, comments
      comment_count = comments.size

      return if comments.empty?
      return if lines.size == 1
      return if lines[comment_count] == "\n"

      lines.insert comment_count, "\n"
    end
1297744
def addComment(self, comment):
        
        url = "%s/addComment" % self.root
        params = {
            "f" : "json",
            "comment" : comment
        }
        return self._post(url, params, proxy_port=self._proxy_port,
                             securityHandler=self._securityHandler,
                             proxy_url=self._proxy_url)
1365708
def add_comment(self, page_id, text):
        
        data = {'type': 'comment',
                'container': {'id': page_id, 'type': 'page', 'status': 'current'},
                'body': {'storage': {'value': text, 'representation': 'storage'}}}
        return self.post('rest/api/content/', data=data)
1071430
protected void appendComment(StringBuilder sb, Comment aNode) {
        sb.append("<!--")
            .append(aNode.getNodeValue())
            .append("-->");
    }
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
56592
@Deprecated
  public boolean addComment(Comment comment) {
    if (getComments() != null) {
      return getComments().addData(comment);
    }
    return false;
  }
1241546
def add_comment(self, line):
        
        if not isinstance(self.last_item, Comment):
            comment = Comment(self._structure)
            self._structure.append(comment)
        self.last_item.add_line(line)
        return self
357770
public void load() throws FileNotFoundException, IOException {
    BufferedReader is = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
    ArrayList<String> buf = new ArrayList<>();
    while (is.ready()) {
      String line = is.readLine();
      // skip comments
      if (line.startsWith(COMMENT_PREFIX)) {
        continue;
      }
      if (line.length() == 0 && !buf.isEmpty()) {
        String title = buf.remove(0);
        store.add(new Pair<>(title, buf));
        buf = new ArrayList<>();
      } else {
        buf.add(line);
      }
    }
    if (!buf.isEmpty()) {
      String title = buf.remove(0);
      store.add(new Pair<>(title, buf));
      buf = new ArrayList<>();
    }
    is.close();
  }
171130
function addComment(form) {
    var node_id = form.find('input[name="node"]').val();
    var parent_id = form.find('input[name="parent"]').val();
    var text = form.find('textarea[name="comment"]').val();
    var proposal = form.find('textarea[name="proposal"]').val();

    if (text == '') {
      showError('Please enter a comment.');
      return;
    }

    // Disable the form that is being submitted.
    form.find('textarea,input').attr('disabled', 'disabled');

    // Send the comment to the server.
    $.ajax({
      type: "POST",
      url: opts.addCommentURL,
      dataType: 'json',
      data: {
        node: node_id,
        parent: parent_id,
        text: text,
        proposal: proposal
      },
      success: function(data, textStatus, error) {
        // Reset the form.
        if (node_id) {
          hideProposeChange(node_id);
        }
        form.find('textarea')
          .val('')
          .add(form.find('input'))
          .removeAttr('disabled');
	var ul = $('#cl' + (node_id || parent_id));
        if (ul.data('empty')) {
          $(ul).empty();
          ul.data('empty', false);
        }
        insertComment(data.comment);
        var ao = $('#ao' + node_id);
        ao.find('img').attr({'src': opts.commentBrightImage});
        if (node_id) {
          // if this was a "root" comment, remove the commenting box
          // (the user can get it back by reopening the comment popup)
          $('#ca' + node_id).slideUp();
        }
      },
      error: function(request, textStatus, error) {
        form.find('textarea,input').removeAttr('disabled');
        showError('Oops, there was a problem adding the comment.');
      }
    });
  }
1270500
function insertComment(comment) {
    var div = createCommentDiv(comment);

    // To avoid stagnating data, don't store the comments children in data.
    comment.children = null;
    div.data('comment', comment);

    var ul = $('#cl' + (comment.node || comment.parent));
    var siblings = getChildren(ul);

    var li = $(document.createElement('li'));
    li.hide();

    // Determine where in the parents children list to insert this comment.
    for(i=0; i < siblings.length; i++) {
      if (comp(comment, siblings[i]) <= 0) {
        $('#cd' + siblings[i].id)
          .parent()
          .before(li.html(div));
        li.slideDown('fast');
        return;
      }
    }

    // If we get here, this comment rates lower than all the others,
    // or it is the only comment in the list.
    ul.append(li.html(div));
    li.slideDown('fast');
  }
1142539
function getCommentLineNumbers(comments) {
            const lines = new Set();

            comments.forEach(comment => {
                for (let i = comment.loc.start.line; i <= comment.loc.end.line; i++) {
                    lines.add(i);
                }
            });

            return lines;
        }
850612
def save(self, *args, **kwargs):
        
        # the following lines determines if the comment is being created or not
        # in case the comment exists the pk attribute is an int
        created = type(self.pk) is not int

        super(UpdateCountsMixin, self).save(*args, **kwargs)

        # this operation must be performed after the parent save
        if created:
            self.update_count()
626677
def comment (self, data):
        
        data = data.encode(self.encoding, "ignore")
        self.fd.write("<!--%s-->" % data)
385309
def delete_comment(self, comment_id):
        """"""

        comment_obj = self.query(Comment).get(comment_id)
        if comment_obj:
            logger.debug("Deleting comment {0}".format(comment_obj.id))

        self.session.delete(comment_obj)
        self.save()

        return comment_obj
698860
public void addComment(String tag, String comment) {
        String nt = normaliseTag(tag);
        if(! comments.containsKey(nt)) {
            comments.put(nt, new ArrayList<String>());
        }
        comments.get(nt).add(comment);
    }