Builds a comment.
554394
def to_comment(value):
  
  if value is None:
    return
  if len(value.split('\n')) == 1:
    return "* " + value
  else:
    return '\n'.join([' * ' + l for l in value.split('\n')[:-1]])
233443
def addcomment(self, comment, private=False):
        
        # Note: fedora bodhi uses this function
        vals = self.bugzilla.build_update(comment=comment,
                                          comment_private=private)
        log.debug("addcomment: update=%s", vals)

        return self.bugzilla.update_bugs(self.bug_id, vals)
1279462
public function addComment($comment)
    {
        $comment->setPaymentId($this->getPaymentId());
        $comment->save();

        $this->load($this->getPaymentId());

        return $comment;
    }
189071
def build(self, builder):
        
        if self.text is None:
            raise ValueError("Text is not set.")
        params = {}
        if self.sponsor_or_site is not None:
            params['SponsorOrSite'] = self.sponsor_or_site

        builder.start("Comment", params)
        builder.data(self.text)
        builder.end("Comment")
1186452
def _handle_comment(self, comment):
        """"""
        if not comment:
            return ''
        start = self.indent_type
        if not comment.startswith('#'):
            start += self._a_to_u(' # ')
        return (start + comment)
1042549
def emit_comments(comments)
      max = comments.size - 1
      comments.each_with_index do |comment, index|
        if comment.type.equal?(:document)
          buffer.append_without_prefix(comment.text.chomp)
        else
          write(comment.text)
        end
        buffer.nl if index < max
      end
    end
1088328
def _append_comment(ret, comment):
    '''
    
    '''
    if ret['comment']:
        ret['comment'] = ret['comment'].rstrip() + '\n' + comment
    else:
        ret['comment'] = comment

    return ret
964998
def comment_lines(lines):
    """"""
    ret = []
    for line in lines:
        ws_prefix, rest, ignore = RE_LINE_SPLITTER_COMMENT.match(line).groups()
        ret.append(ws_prefix + '#' + rest)
    return ''.join(ret)
227697
def add_comment(self, post=None, name=None, email=None, pub_date=None,
                    website=None, body=None):
        
        if post is None:
            if not self.posts:
                raise CommandError("Cannot add comments without posts")
            post = self.posts[-1]
        post["comments"].append({
            "user_name": name,
            "user_email": email,
            "submit_date": pub_date,
            "user_url": website,
            "comment": body,
        })
1206046
def comment(opts)
      opts = opts.merge(:sale_id => self.sale_id)
      Twocheckout::API.request(:post, 'sales/create_comment', opts)
    end
1043923
function comment() {
        whitespace();

        if (css[0] !== '/' || css[1] !== '*') {
            return;
        }

        let i = 2;

        while (css[i] && (css[i] !== '*' || css[i + 1] !== '/')) {
            i++;
        }

        if (!css[i]) {
            return error('end of comment is missing');
        }

        const str = css.slice(2, i);

        css = css.slice(i + 2);

        return {
            type   : 'comment',
            comment: str
        };
    }
609914
def comment(string, options = {})
      options = {
        style: :css,
        per_line: true
      }.update(options)

      commenters = {
        html: proc { |s| "<!-- #{s} -->" },
        css: proc { |s| "/* #{s} */" },
        js: proc { |s| "/* #{s} */" }
      }

      commenter = commenters[options[:style]] || commenters[:js]

      if options[:per_line]
        string = string.split(/\r?\n/)
        string.map { |s| commenter.call(s) }.join("\n")
      else
        commenter.call(string)
      end
    end
1355578
def comment_line(comment)
      # Take care of annotation only if matched
      if comment.match(ProbeDockProbe::Annotation::ANNOTATION_REGEXP)
        # If the feature already started, the annotations are for scenarios
        if @current_feature_started
          @annotation = ProbeDockProbe::Annotation.new(comment)
        else
          @feature_annotation = ProbeDockProbe::Annotation.new(comment)
        end
      end
    end
1319336
static Comment createCommentFromToken(Token token) {
        String commentText = token.image;
        if (token.kind == JAVADOC_COMMENT) {
            return new JavadocComment(tokenRange(token), commentText.substring(3, commentText.length() - 2));
        } else if (token.kind == MULTI_LINE_COMMENT) {
            return new BlockComment(tokenRange(token), commentText.substring(2, commentText.length() - 2));
        } else if (token.kind == SINGLE_LINE_COMMENT) {
            // line comments have their end of line character(s) included, and we don't want that.
            Range range = new Range(pos(token.beginLine, token.beginColumn), pos(token.endLine, token.endColumn));
            while (commentText.endsWith("\r") || commentText.endsWith("\n")) {
                commentText = commentText.substring(0, commentText.length() - 1);
            }
            range = range.withEnd(pos(range.begin.line, range.begin.column + commentText.length()));
            LineComment comment = new LineComment(tokenRange(token), commentText.substring(2));
            comment.setRange(range);
            return comment;
        }
        throw new AssertionError("Unexpectedly got passed a non-comment token.");
    }
601838
function withComment (example, comment) {
  const constructor = example == null ? null : example.constructor;

  if (constructor === Object || constructor === Array) {
    Object.defineProperty(example, '_comment', {
      value: comment,
      enumerable: false
    });

    return example;
  }

  // Convert primitives
  return new PrimitiveWithComment(example, comment);
}
1220057
def comments(self, tag, limit=0):
        """"""

        return [comment for comment in CommentsMatch(tag).get_comments(limit)]
13681
function comment() {
    var ret = this.seq(
        this.stringf(";"),
        this.manyf(this.choicef(WSP, VCHAR)),
        CRLF);
    return new ast.Comment(ret[2]);
}