Filters JSDoc comments for those tagged with '@swagger'
@function
@param {array} jsDocComments - JSDoc comments
@returns {array} JSDoc comments tagged with '@swagger'
@requires js-yaml
974432
function filterJsDocComments(jsDocComments) {
  const swaggerJsDocComments = [];

  for (let i = 0; i < jsDocComments.length; i += 1) {
    const jsDocComment = jsDocComments[i];
    for (let j = 0; j < jsDocComment.tags.length; j += 1) {
      const tag = jsDocComment.tags[j];
      if (tag.title === 'swagger') {
        swaggerJsDocComments.push(jsYaml.safeLoad(tag.description));
      }
    }
  }

  return swaggerJsDocComments;
}
694038
def _docspec_comments(obj) -> Dict[str, str]:
    
    # Sometimes our docstring is on the class, and sometimes it's on the initializer,
    # so we've got to check both.
    class_docstring = getattr(obj, '__doc__', None)
    init_docstring = getattr(obj.__init__, '__doc__', None) if hasattr(obj, '__init__') else None

    docstring = class_docstring or init_docstring or ''

    doc = NumpyDocString(docstring)
    params = doc["Parameters"]
    comments: Dict[str, str] = {}

    for line in params:
        # It looks like when there's not a space after the parameter name,
        # numpydocstring parses it incorrectly.
        name_bad = line[0]
        name = name_bad.split(":")[0]

        # Sometimes the line has 3 fields, sometimes it has 4 fields.
        comment = "\n".join(line[-1])

        comments[name] = comment

    return comments
788299
function(id, params, headers, callback) {
        var url;
        url = this.client.url() + ("comments/" + (id || ''));
        return this.client.patch(url, params, headers, callback);
      }
766189
function smartComment(description/*:string*/ = '', links/*: string[]*/ = []) {
  const descriptionLines = description.replace(/(.{1,72}\s)\s*?/g, '\n * $1')
  const linksLines = links.reduce((acc, link) => (
    `${acc} * @see ${link}\n`
  ), '')

  return commentBlock(`*${descriptionLines}\n${linksLines} `)
}
1316630
function identifyCommentType(tag) {
    var commentType = null;
    for (var tagName in tag) {
        if (tag.hasOwnProperty(tagName)) {
            switch (tagName) {
                case exports.TAG_NAMES.API:
                case exports.TAG_NAMES.METHOD:
                case exports.TAG_NAMES.METHOD_SIGNATURE:
                case exports.TAG_NAMES.METHOD_NAME:
                case exports.TAG_NAMES.PARAM:
                case exports.TAG_NAMES.RETURN:
                case exports.TAG_NAMES.THROWS:
                    commentType = exports.COMMENT_TYPES.METHOD;
                    break;
                case exports.TAG_NAMES.MODULE:
                case exports.TAG_NAMES.REQUIRES:
                    commentType = exports.COMMENT_TYPES.MODULE;
                    break;
                case exports.TAG_NAMES.CLASS:
                    commentType = exports.COMMENT_TYPES.TYPE;
                    break;
                case exports.TAG_NAMES.VARIABLE_NAME:
                    commentType = exports.COMMENT_TYPES.VARIABLE;
                    break;
            }
        }
    }

    return commentType;
}
1317478
function parse( doxComment, options ) {
   if( !( 'ctx' in doxComment ) ) {
      doxComment.ctx = false;
   }

   const parsed = {
      // An explicitly given name is used in favor of a derived one.
      name: ( tagsByType( doxComment.tags, 'name', 'directive', 'injection', 'module' )[ 0 ] || {} ).string ||
         doxComment.ctx.name ||
         '- unknown -',
      description: description( doxComment ),
      dox: doxComment
   };

   const optional = [];
   parsed.params = tagsByType( doxComment.tags, 'param' )
      .map( tag => {
         const cleanName = tag.name.replace( /^\[?([^\]]*)]?$/g, '$1' );
         const parents = cleanName.split( '.' ).slice( 0, -1 );
         if( tag.optional ) {
            optional.push( cleanName );
         }
         else if( parents.some( p => optional.indexOf( p ) !== -1 ) ) {
            // a property of an optional object parameter is optional too
            optional.push( cleanName );
            tag.optional = true;
         }

         return {
            name: cleanName,
            types: tag.types.length === 0 ? [ '*' ] : tag.types,
            description: convertLineBreaks( description( tag ) ),
            dox: tag
         };
      } );

   parsed.paramsForArgsList = parsed.params
      // filter out object parameter properties for argument list
      .filter( param => param.name.indexOf( '.' ) === -1 )
      .map( param => param.name );

   parsed.returns = tagsByType( doxComment.tags, 'return', 'returns' )
      .map( tag =>
         ({
            name: tag.name,
            types: tag.types.length === 0 ? [ '*' ] : tag.types,
            description: convertLineBreaks( description( tag ) ),
            dox: tag
         })
      )[ 0 ] || null;

   if( options.verbose ) {
      /* eslint-disable no-console */
      console.log( JSON.stringify( parsed, null, 3 ) );
      /* eslint-enable no-console */
   }

   return parsed;
}
624167
function(id, params, headers, callback) {
        var url;
        url = this.client.url() + ("comments/" + (id || ''));
        return this.client.del(url, params, headers, callback);
      }
1292651
function(hljs) {
  return {
    case_insensitive: true,
    illegal: /\S/,
    contains: [
      {
        className: 'comment',
        begin: ';', end: '$'
      },
      {
        className: 'title',
        begin: '^\\[', end: '\\]'
      },
      {
        className: 'setting',
        begin: '^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*', end: '$',
        contains: [
          {
            className: 'value',
            endsWithParent: true,
            keywords: 'on off true false yes no',
            contains: [hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE],
            relevance: 0
          }
        ]
      }
    ]
  };
}
1015948
function onComment(block, text, start, stop, startLoc, endLoc) {
      var match;
      commentsByEndLine[endLoc.line] = {
        text: text,
        block: block
      };
      match = text.match(/@module (\w+)/);
      if (match) {
        moduleName = match[1];
        modules.push({
          name: moduleName,
          comment: '/*' + text + '*/\n'
        });
      }
      // Both @module and @namespace may be defined in the same comment block.
      match = text.match(/@(namespace|module) \w+/g);
      if (match) {
        if (text.match(/@method/)) {
          // Don't allow temporary namespace renamings
          // in method block.
          return;
        }
        var namespace = match[match.length - 1].match(/@(namespace|module) (\w+)/)[2];
        namespaceBoundary(namespace, endLoc.line);
      }
    }
383836
private JSDocInfo parseInlineTypeDoc(Comment node) {
    String comment = node.value;
    int lineno = lineno(node.location.start);
    int charno = charno(node.location.start);

    // The JsDocInfoParser expects the comment without the initial '/**'.
    int numOpeningChars = 3;
    JsDocInfoParser parser =
      new JsDocInfoParser(
          new JsDocTokenStream(comment.substring(numOpeningChars),
              lineno,
              charno + numOpeningChars),
          comment,
          node.location.start.offset,
          templateNode,
          config,
          errorReporter);
    return parser.parseInlineTypeDoc();
  }
1347485
function() {
    // First deal only with doc-comments
    doc_comments = _.filter(docs, function(d) {
      return d["type"] == "doc_comment";
    });

    // Detect code in each docset.  Sometimes a docset has already
    // been detected as part of detecting some previous docset (like
    // Class detecting all of its configs) - in such case, skip.
    _.each(doc_comments, function(docset) {
      code = docset["code"];
      
      if ( !(code && code["tagname"]) )
        docset["code"] = detect(code);
      else
        docset["code"] = "";
    });

    // Return all doc-comments + other comments for which related
    // code was detected.
    return _.filter(docs, function(d) {
      return d["type"] == "doc_comment" || d["code"] && d["code"]["tagname"];
    });
  }
671256
function parseJsDoc(filePath, jsdoc) {
  return jsdoc.explain({files:[filePath]}).then(items=>{
    const data = {};
    items.forEach(item=>{
      if (!item.undocumented && !data.hasOwnProperty(item.longname)) {
        data[item.longname] =  {
          name: item.name,
          description: item.classdesc || item.description
        };
      }
    });

    return data;
  });
}
591846
function checkComment(node) {
            if (astUtils.isDirectiveComment(node) && selfConfigRegEx.test(node.value)) {
                return;
            }

            const matches = commentContainsWarningTerm(node.value);

            matches.forEach(matchedTerm => {
                context.report({
                    node,
                    message: "Unexpected '{{matchedTerm}}' comment.",
                    data: {
                        matchedTerm
                    }
                });
            });
        }
1206894
function isJSDoc(commentGroup) {
            const lines = commentGroup[0].value.split(astUtils.LINEBREAK_MATCHER);

            return commentGroup[0].type === "Block" &&
                /^\*\s*$/u.test(lines[0]) &&
                lines.slice(1, -1).every(line => /^\s* /u.test(line)) &&
                /^\s*$/u.test(lines[lines.length - 1]);
        }
974683
function printDanglingComments(path, options, sameIndent, filter) {
  const parts = [];
  const node = path.getValue();

  if (!node || !node.comments) {
    return "";
  }

  path.each(commentPath => {
    const comment = commentPath.getValue();
    if (
      comment &&
      !comment.leading &&
      !comment.trailing &&
      (!filter || filter(comment))
    ) {
      parts.push(printComment(commentPath, options));
    }
  }, "comments");

  if (parts.length === 0) {
    return "";
  }

  if (sameIndent) {
    return join(hardline, parts);
  }
  return indent(concat([hardline, join(hardline, parts)]));
}
827294
function getComments(comments) {
  if (!comments || !comments.body) return {};

  Object.assign(comments, {
    create_time: formatTime(comments.created_at),
    update_time: formatTime(comments.updated_at)
  })

  return comments;
}
601695
function addComment( text, multiline ) {

          if ( options.extractComments ) {

              const loc = location();

              comments[ loc.start.offset ] = {
                  text: text,
                  multiline: multiline,
                  location: loc,
              };

          }

          return text;

      }