Filters out types with @external annotations and adds their @see link to the
externalTypes table

@param {Array.<Object>} docs The jsdoc list.
977394
function(docs) {
  return _.reject(docs, function (doc) {
    if (!!doc.external) {
      externalTypes[doc.name] = doc.see[0];
      return true;
    }
    return false;
  });
}
228522
function Highlighter(doc, type) {
        type = type || "textContent";
        this.doc = doc || document;
        this.classAppliers = {};
        this.highlights = [];
        this.converter = getConverter(type);
    }
287407
function simpleTypeFilter(newDoc, oldDoc, candidateDocType) {
    if (oldDoc) {
      if (newDoc._deleted) {
        return oldDoc.type === candidateDocType;
      } else {
        return newDoc.type === oldDoc.type && oldDoc.type === candidateDocType;
      }
    } else {
      return newDoc.type === candidateDocType;
    }
  }
424045
private void parseDoctypedecl() throws Exception {
        String rootName;
        ExternalIdentifiers ids;

        // Read the document type name.
        requireWhitespace();
        rootName = readNmtoken(true);

        // Read the External subset's IDs
        skipWhitespace();
        ids = readExternalIds(false, true);

        // report (a) declaration of name, (b) lexical info (ids)
        handler.doctypeDecl(rootName, ids.publicId, ids.systemId);

        // Internal subset is parsed first, if present
        skipWhitespace();
        if (tryRead('[')) {

            // loop until the subset ends
            while (true) {
                doReport = expandPE = true;
                skipWhitespace();
                doReport = expandPE = false;
                if (tryRead(']')) {
                    break; // end of subset
                } else {
                    // WFC, PEs in internal subset (only between decls)
                    peIsError = expandPE = true;
                    parseMarkupdecl();
                    peIsError = expandPE = false;
                }
            }
        }
        skipWhitespace();
        require('>');

        // Read the external subset, if any
        InputSource subset;

        if (ids.systemId == null) {
            subset = handler.getExternalSubset(rootName, handler.getSystemId());
        } else {
            subset = null;
        }
        if ((ids.systemId != null) || (subset != null)) {
            pushString(null, ">");

            // NOTE: [dtd] is so we say what SAX2 expects,
            // though it's misleading (subset, not entire dtd)
            if (ids.systemId != null) {
                pushURL(true, "[dtd]", ids, null, null, null, true);
            } else {
                handler.warn("modifying document by adding external subset");
                pushURL(true, "[dtd]", new ExternalIdentifiers(
                        subset.getPublicId(), subset.getSystemId(), null),
                        subset.getCharacterStream(), subset.getByteStream(),
                        subset.getEncoding(), false);
            }

            // Loop until we end up back at '>'
            while (true) {
                doReport = expandPE = true;
                skipWhitespace();
                doReport = expandPE = false;
                if (tryRead('>')) {
                    break;
                } else {
                    expandPE = true;
                    parseMarkupdecl();
                    expandPE = false;
                }
            }

            // the ">" string isn't popped yet
            if (inputStack.size() != 1) {
                fatal("external subset has unmatched '>'");
            }
        }

        // done dtd
        handler.endDoctype();
        expandPE = false;
        doReport = true;
    }
1121108
def _writetypesdoc(doc, thing, forceload=0):
    
    try:
        object, name = pydoc.resolve(thing, forceload)
        name = os.path.join(doc, name + '.html')
    except (ImportError, pydoc.ErrorDuringImport), value:
        log.debug(str(value))
        return
        
    # inner classes
    cdict = {}
    fdict = {}
    elements_dict = {}
    types_dict = {}
    for kname,klass in inspect.getmembers(thing, inspect.isclass):
        if thing is not inspect.getmodule(klass):
            continue
        
        cdict[kname] = inspect.getmembers(klass, inspect.isclass)
        for iname,iklass in cdict[kname]:
            key = (kname,iname)
            fdict[key] = _writedoc(doc, iklass)
            if issubclass(iklass, ElementDeclaration):
                
                try:
                    typecode = iklass()
                except (AttributeError,RuntimeError), ex:
                    elements_dict[iname] = _writebrokedoc(doc, ex, iname)
                    continue

                elements_dict[iname] = None
                if typecode.pyclass is not None:                        
                    elements_dict[iname] = _writedoc(doc, typecode.pyclass)

                continue

            if issubclass(iklass, TypeDefinition):
                try:
                    typecode = iklass(None)
                except (AttributeError,RuntimeError), ex:
                    types_dict[iname] = _writebrokedoc(doc, ex, iname)
                    continue

                types_dict[iname] = None
                if typecode.pyclass is not None:
                    types_dict[iname] = _writedoc(doc, typecode.pyclass)

                continue
                        
                
    def strongarm(self, object, name=None, mod=None, funcs={}, classes={}, *ignored):
        """Produce HTML documentation for a class object."""
        realname = object.__name__
        name = name or realname
        bases = object.__bases__
        object, name = pydoc.resolve(object, forceload)
        contents = []
        push = contents.append
        if name == realname:
            title = '<a name="%s">class <strong>%s</strong></a>' % (
                name, realname)
        else:   
            title = '<strong>%s</strong> = <a name="%s">class %s</a>' % (
                name, name, realname)
                
        mdict = {}
        if bases:
            parents = []
            for base in bases:
                parents.append(self.classlink(base, object.__module__))
            title = title + '(%s)' % pydoc.join(parents, ', ')
            
        doc = self.markup(pydoc.getdoc(object), self.preformat, funcs, classes, mdict)
        doc = doc and '<tt>%s<br>&nbsp;</tt>' % doc
        for iname,iclass in cdict[name]:
            fname = fdict[(name,iname)]

            if elements_dict.has_key(iname):
                push('class <a href="%s">%s</a>: element declaration typecode<br/>'\
                    %(fname,iname))
                pyclass = elements_dict[iname]
                if pyclass is not None:
                    push('<ul>instance attributes:')
                    push('<li><a href="%s">pyclass</a>: instances serializable to XML<br/></li>'\
                        %elements_dict[iname])
                    push('</ul>')
            elif types_dict.has_key(iname):
                push('class <a href="%s">%s</a>: type definition typecode<br/>' %(fname,iname))
                pyclass = types_dict[iname]
                if pyclass is not None:
                    push('<ul>instance attributes:')
                    push('<li><a href="%s">pyclass</a>: instances serializable to XML<br/></li>'\
                          %types_dict[iname])
                    push('</ul>')
            else:
                push('class <a href="%s">%s</a>: TODO not sure what this is<br/>' %(fname,iname))
                
        contents = ''.join(contents)
        return self.section(title, '#000000', '#ffc8d8', contents, 3, doc) 
    
    doclass = pydoc.HTMLDoc.docclass
    pydoc.HTMLDoc.docclass = strongarm
            
    try:
        page = pydoc.html.page(pydoc.describe(object), pydoc.html.document(object, name))
        file = open(name, 'w')
        file.write(page)
        file.close()
    except (ImportError, pydoc.ErrorDuringImport), value:
        log.debug(str(value))
        
    pydoc.HTMLDoc.docclass = doclass
490417
function doc_builder(doc) {
				if(is.array(doc)) {
					return ARRAY(doc).map(_doc_builder).valueOf();
				}
				return _doc_builder(doc);
			}
1371797
function serializeDoctype (node) {
  var r = '<!DOCTYPE ' + node.name;

  if (node.publicId) {
    r += ' PUBLIC "' + node.publicId + '"';
  }

  if (!node.publicId && node.systemId) {
    r += ' SYSTEM';
  }

  if (node.systemId) {
    r += ' "' + node.systemId + '"';
  }

  r += '>';
  return r;
}
1168977
private static org.w3c.dom.Document toDom(final Document doc) {
        try {
            val xmlOutputter = new XMLOutputter();
            val elemStrWriter = new StringWriter();
            xmlOutputter.output(doc, elemStrWriter);
            val xmlBytes = elemStrWriter.toString().getBytes(Charset.defaultCharset());
            val dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
            dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
            dbf.setFeature("http://apache.org/xml/features/validation/schema/normalized-value", false);
            dbf.setFeature("http://javax.xml.XMLConstants/feature/secure-processing", true);
            dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
            dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);

            return dbf.newDocumentBuilder().parse(new ByteArrayInputStream(xmlBytes));
        } catch (final Exception e) {
            LOGGER.trace(e.getMessage(), e);
            return null;
        }
    }
426898
function validateDoc (doc) {
  let issues = []

  function ignore (field) {
    return IGNORE_WARNINGS[field].indexOf(doc.name) !== -1
  }

  if (!doc.name) {
    issues.push('name missing in document')
  }

  if (!doc.description) {
    issues.push('function "' + doc.name + '": description missing')
  }

  if (!doc.syntax || doc.syntax.length === 0) {
    issues.push('function "' + doc.name + '": syntax missing')
  }

  if (!doc.examples || doc.examples.length === 0) {
    issues.push('function "' + doc.name + '": examples missing')
  }

  if (doc.parameters && doc.parameters.length) {
    doc.parameters.forEach(function (param, index) {
      if (!param.name || !param.name.trim()) {
        issues.push('function "' + doc.name + '": name missing of parameter ' + index + '')
      }
      if (!param.description || !param.description.trim()) {
        issues.push('function "' + doc.name + '": description missing for parameter ' + (param.name || index))
      }
      if (!param.types || !param.types.length) {
        issues.push('function "' + doc.name + '": types missing for parameter ' + (param.name || index))
      }
    })
  } else {
    if (!ignore('parameters')) {
      issues.push('function "' + doc.name + '": parameters missing')
    }
  }

  if (doc.returns) {
    if (!doc.returns.description || !doc.returns.description.trim()) {
      issues.push('function "' + doc.name + '": description missing of returns')
    }
    if (!doc.returns.types || !doc.returns.types.length) {
      issues.push('function "' + doc.name + '": types missing of returns')
    }
  } else {
    if (!ignore('returns')) {
      issues.push('function "' + doc.name + '": returns missing')
    }
  }

  if (!doc.seeAlso || doc.seeAlso.length === 0) {
    if (!ignore('seeAlso')) {
      issues.push('function "' + doc.name + '": seeAlso missing')
    }
  }

  return issues
}
1180696
private void applyStyles(Document doc) {
        Elements allStyledElements = doc.getElementsByAttribute(CSS_STYLE);

        for (Element e : allStyledElements) {
            String newStyle = e.attr(CSS_STYLE);
            String oldStyle = e.attr(STYLE_ATTR);
            e.attr(STYLE_ATTR, (newStyle + "; " + oldStyle).replace(";;", ";"));
            e.removeAttr(CSS_STYLE);
        }
    }
1086555
void fillJSDocInfo(Node externs, Node root) {
    NodeTraversal.traverseRoots(
        compiler, new JSDocInfoCollector(compiler.getTypeRegistry()), externs, root);

    // Create references to parameters in the JSDoc.
    for (Symbol sym : getAllSymbols()) {
      JSDocInfo info = sym.getJSDocInfo();
      if (info == null) {
        continue;
      }

      for (Marker marker : info.getMarkers()) {
        SourcePosition<Node> pos = marker.getNameNode();
        if (pos == null) {
          continue;
        }

        Node paramNode = pos.getItem();
        String name = paramNode.getString();
        Symbol param = getParameterInFunction(sym, name);
        if (param == null) {
          // There is no reference to this parameter in the actual JavaScript
          // code, so we'll try to create a special JsDoc-only symbol in
          // a JsDoc-only scope.
          SourcePosition<Node> typePos = marker.getType();
          JSType type = null;
          if (typePos != null) {
            type = typePos.getItem().getJSType();
          }

          if (sym.docScope == null) {
            sym.docScope =
                new SymbolScope(
                    null /* root */, null /* parent scope */, null /* type of this */, sym);
          }

          // Check to make sure there's no existing symbol. In theory, this
          // should never happen, but we check anyway and fail silently
          // if our assumptions are wrong. (We do not want to put the symbol
          // table into an invalid state).
          Symbol existingSymbol = isAnySymbolDeclared(name, paramNode, sym.docScope);
          if (existingSymbol == null) {
            declareSymbol(name, type, type == null, sym.docScope, paramNode, null /* info */);
          }
        } else {
          param.defineReferenceAt(paramNode);
        }
      }
    }
  }
23540
public Type externalType(Types types) {
        Type t = erasure(types);
        if (name == name.table.names.init && owner.hasOuterInstance()) {
            Type outerThisType = types.erasure(owner.type.getEnclosingType());
            return new MethodType(t.getParameterTypes().prepend(outerThisType),
                                  t.getReturnType(),
                                  t.getThrownTypes(),
                                  t.tsym);
        } else {
            return t;
        }
    }
616136
function cleanDocs(docs) {
  for (var i = 0; i < docs.length; i++) {
    var doc = docs[i];
    if (doc._deleted) {
      delete doc._attachments; // ignore atts for deleted docs
    } else if (doc._attachments) {
      // filter out extraneous keys from _attachments
      var atts = Object.keys(doc._attachments);
      for (var j = 0; j < atts.length; j++) {
        var att = atts[j];
        doc._attachments[att] = pouchdbUtils.pick(doc._attachments[att],
          ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);
      }
    }
  }
}
257326
def to_class_objects(docs, opts)
      classes = docs.map {|d| Class.new(d) }
      Relations.new(classes, opts.external)
    end
1322997
private void validateReturnJsDoc(Node n, JSDocInfo info) {
    if (!n.isReturn() || info == null) {
      return;
    }
    // @type is handled in validateTypeAnnotations method.
    if (info.containsDeclaration() && !info.hasType()) {
      report(n, JSDOC_ON_RETURN);
    }
  }
127025
public SparkDocumentStream annotate(@NonNull AnnotatableType... types) {
      return new SparkDocumentStream(source.map(json -> {
         Hermes.initializeWorker(configBroadcast.value());
         if (Document.hasAnnotations(json, types)) {
            return json;
         }
         Document document = Document.fromJson(json);
         Pipeline.process(document, types);
         return document.toJson();
      }));
   }
878893
function doctype(node) {
  return document.implementation.createDocumentType(
    node.name || 'html',
    node.public || '',
    node.system || '',
  );
}