Returns a sparse array of comment tags
358938
function findTags(code) {
  const tags = []
  findTag(code, '\n', tags)
  findTag(code, '//', tags)
  findTag(code, '/*', tags)
  findTag(code, '*/', tags)
  return tags
}
896294
def commentList(request):
    
    if request.method == 'POST':
        return post(request)

    comments = []
    guid = request.GET.get('guid', None)

    if guid:
        obj = getObjectsFromGuids([guid])[0]
        if obj.AssetType == 1:
            model = 'image'
        else:
            model = 'video'
        contenttype = ContentType.objects.get(app_label="frog", model=model)
        comments = Comment.objects.filter(object_pk=obj.id, content_type=contenttype)

    res = Result()
    for comment in comments:
        res.append(commentToJson(comment))
    return JsonResponse(res.asDict())
195069
def extract_cncomment_xml(comment):
    

    comment = comment.replace(' xmlns="http://www.asam.net/mdf/v4"', "")
    try:
        comment = ET.fromstring(comment)
        match = comment.find(".//TX")
        if match is None:
            common_properties = comment.find(".//common_properties")
            if common_properties is not None:
                comment = []
                for e in common_properties:
                    field = f'{e.get("name")}: {e.text}'
                    comment.append(field)
                comment = "\n".join(field)
            else:
                comment = ""
        else:
            comment = match.text or ""
    except ET.ParseError:
        pass

    return comment
368964
function getCommentsList(comments) {
  if (!comments.body || !comments.headers) return;

  let pageInfo = getPage(comments.headers.link);
  let pageList = [];

  comments.body.forEach((item) => {
    pageList.push(getComments(item));
  });

  return {
    page: pageInfo,
    list: pageList
  }
}
481218
function sortedMerge(tokens, comments) {
    const result = [];
    let tokenIndex = 0;
    let commentIndex = 0;

    while (tokenIndex < tokens.length || commentIndex < comments.length) {
        if (commentIndex >= comments.length || tokenIndex < tokens.length && tokens[tokenIndex].range[0] < comments[commentIndex].range[0]) {
            result.push(tokens[tokenIndex++]);
        } else {
            result.push(comments[commentIndex++]);
        }
    }

    return result;
}
1072916
def combine_comments(comments):
    '''
    
    '''
    if isinstance(comments, list):
        for idx in range(len(comments)):
            if not isinstance(comments[idx], six.string_types):
                comments[idx] = six.text_type(comments[idx])
    else:
        if not isinstance(comments, six.string_types):
            comments = [six.text_type(comments)]
        else:
            comments = [comments]
    return ' '.join(comments).strip()
767554
def get_comments(self):
        
        return github.PaginatedList.PaginatedList(
            github.CommitComment.CommitComment,
            self._requester,
            self.url + "/comments",
            None
        )
1091110
def comments(self, case_id=None, variant_id=None, username=None):
        
        logger.debug("Looking for comments")
        comment_objs = self.query(Comment)

        if case_id:
            comment_objs = comment_objs.filter_by(case_id=case_id)

        if variant_id:
            comment_objs = comment_objs.filter_by(variant_id=variant_id)
        elif case_id:
            comment_objs = comment_objs.filter_by(variant_id=None)

        return comment_objs
1157248
def _extract_more_comments(tree):
        """"""
        more_comments = []
        queue = [(None, x) for x in tree]
        while len(queue) > 0:
            parent, comm = queue.pop(0)
            if isinstance(comm, MoreComments):
                heappush(more_comments, comm)
                if parent:
                    parent.replies.remove(comm)
                else:
                    tree.remove(comm)
            else:
                for item in comm.replies:
                    queue.append((comm, item))
        return more_comments
1084379
def _filter(self, text, context, encoding):
        """"""

        content = []
        self.current_encoding = encoding
        self.line_num = 1
        self.prev_line = -1
        self.leading = ''
        self.block_comments = []
        self.line_comments = []

        self.find_content(text)
        self.extend_src(content, context)

        return content
408331
def associated_comments
      @associated_comments ||= begin
        result = {}
        Parser::Source::Comment.associate_locations(node, comments).each_pair do |loc, all|
          block = all #.select{ |l| l.document? || code.lines[l.loc.line].strip.start_with?('#')}
          next if block.empty?
          result[loc.line] ||= []
          result[loc.line].concat block
        end
        result
      end
    end
1174413
public List<String> getComments(String tag) {
        List<String> c = comments.get( normaliseTag(tag) );
        if(c == null) {
            return new ArrayList<String>();
        } else {
            return c;
        }
    }
763051
def __parse_comments():
    ''''''
    filename = get_file('comments.tsv')

    with io.open(filename, 'r', encoding='cp1252') as textfile:
        next(textfile)

        for line in textfile:
            tokens = line.strip().split('\t')
            chebi_id = int(tokens[1])

            if chebi_id not in __COMMENTS:
                __COMMENTS[chebi_id] = []

            # Append Comment:
            com = Comment(tokens[3],
                          tokens[4],
                          tokens[5],
                          datetime.datetime.strptime(tokens[2], '%Y-%M-%d'))

            __COMMENTS[chebi_id].append(com)
357011
def get_comments_at_indexes(self, indexes):
        """"""
        s = self.style[indexes]
        has_comments = np.where(s & comment_bit_mask > 0)[0]
        comments = []
        for where_index in has_comments:
            raw = self.get_raw_index(indexes[where_index])
            try:
                comment = self.rawdata.extra.comments[raw]
            except KeyError:
                comment = None
            comments.append(comment)
        return has_comments, comments
763206
function getCommentLocatuons(node) {
            const contentStartIndex = node.commentOpen.range[1]
            const contentEndIndex = node.commentClose.range[0]
            const contentText = sourceCode.text.slice(
                contentStartIndex,
                contentEndIndex
            )
            const contentFirstIndex = (() => {
                const index = contentText.search(/\S/u)
                if (index >= 0) {
                    return index + contentStartIndex
                }
                return contentEndIndex
            })()
            const contentLastIndex = (() => {
                const index = contentText.search(/\S\s*$/gu)
                if (index >= 0) {
                    return index + contentStartIndex + 1
                }
                return contentStartIndex
            })()

            return {
                first: {
                    index: contentFirstIndex,
                    loc: sourceCode.getLocFromIndex(contentFirstIndex),
                },
                last: {
                    index: contentLastIndex,
                    loc: sourceCode.getLocFromIndex(contentLastIndex),
                },
            }
        }
1265412
function getDescriptions(comments) {
  var ret = {
    component: comments.description || null,
    props: {}
  };
  comments.tags.forEach(function (tag) {
    if (tag.name) {
      ret.props[tag.name] = tag.description || null;
    }
  });
  return ret;
}
115322
def get_tags(doc):
    '''
    
    '''
    tags = list()

    for el in doc.getroot().iter():
        if isinstance(el, lxml.html.HtmlElement):
            tags.append(el.tag)
        elif isinstance(el, lxml.html.HtmlComment):
            tags.append('comment')
        else:
            raise ValueError('Don\'t know what to do with element: {}'.format(el))

    return tags