javadoc from Writable
192353
public void readFields(DataInput in) throws IOException {
    byte version = in.readByte();                 // read version
    if (version != getVersion())
      throw new VersionMismatchException(getVersion(), version);
  }
1054039
@Override
    public void renderDoc(Doc doc) {
        // hide text that looks like tags (such as annotations in source code) from Javadoc
        doc.setRawCommentText(doc.getRawCommentText().replaceAll("@([A-Z])", "{@literal @}$1"));

        StringBuilder buffer = new StringBuilder();
        buffer.append(render(doc.commentText(), false));
        buffer.append('\n');
        for (Tag tag : doc.tags()) {
            renderTag(tag, buffer);
            buffer.append('\n');
        }
        doc.setRawCommentText(buffer.toString());
    }
66290
function() {
      var t = this,
          writableAttributes = t.get('writableAttributes'),
          writableChanges = {};

      // Add any writable changes
      var probeAttrs = t.toProbeJSON();
      delete probeAttrs.id;
      for (var attrName in probeAttrs) {
        var isWritable = writableAttributes === '*' || writableAttributes.indexOf(attrName) >= 0;
        if (isWritable && !(_.isEqual(t.attributes[attrName], t._probeValues[attrName]))) {
          writableChanges[attrName] = t.attributes[attrName];
        }
      }

      // Pass any writable changes on to control.set()
      if (Monitor._.size(writableChanges)) {
        t.control('set', writableChanges, function(error) {
          if (error) {
            log.error('probeSet', 'Problem setting writable value', writableChanges, t.toMonitorJSON());
          }
        });
      }
    }
370689
private ReservedElement readReserved(Location location, String documentation) {
    ImmutableList.Builder<Object> valuesBuilder = ImmutableList.builder();

    while (true) {
      char c = reader.peekChar();
      if (c == '"' || c == '\'') {
        valuesBuilder.add(reader.readQuotedString());
      } else {
        int tagStart = reader.readInt();

        c = reader.peekChar();
        if (c != ',' && c != ';') {
          if (!reader.readWord().equals("to")) {
            throw reader.unexpected("expected ',', ';', or 'to'");
          }
          int tagEnd = reader.readInt();
          valuesBuilder.add(Range.closed(tagStart, tagEnd));
        } else {
          valuesBuilder.add(tagStart);
        }
      }
      c = reader.readChar();
      if (c == ';') break;
      if (c != ',') throw reader.unexpected("expected ',' or ';'");
    }

    ImmutableList<Object> values = valuesBuilder.build();
    if (values.isEmpty()) {
      throw reader.unexpected("'reserved' must have at least one field name or tag");
    }
    return new ReservedElement(location, documentation, values);
  }
892362
WriteResult writeDocument(RestClient restClient,
                              String key,
                              Boolean randomizeKeys) throws Exception {
        if (isBulkWrite) {
            writeBatchSizeWorthOfDocs(restClient, key, randomizeKeys);
        } else {
            writeSingleDoc(restClient, key, randomizeKeys);
        }

        return WriteResult.PROVISIONAL_RESULT_THAT_ASSUMES_ALL_WENT_WELL;
    }
299957
private ExtendElement readExtend(Location location, String documentation) {
    String name = reader.readName();

    reader.require('{');
    ImmutableList.Builder<FieldElement> fields = ImmutableList.builder();
    while (true) {
      String nestedDocumentation = reader.readDocumentation();
      if (reader.peekChar('}')) break;

      Object declared = readDeclaration(nestedDocumentation, Context.EXTEND);
      if (declared instanceof FieldElement) {
        fields.add((FieldElement) declared);
      }
    }
    return new ExtendElement(location, name, documentation, fields.build());
  }
184520
@Override
  public ODocument toStream() {
    acquireExclusiveLock();
    try {
      document.setInternalStatus(ORecordElement.STATUS.UNMARSHALLING);

      try {
        final ORecordTrackedSet idxs = new ORecordTrackedSet(document);

        for (final OIndexInternal<?> i : indexes.values()) {
          idxs.add(i.updateConfiguration());
        }
        document.field(CONFIG_INDEXES, idxs, OType.EMBEDDEDSET);

      } finally {
        document.setInternalStatus(ORecordElement.STATUS.LOADED);
      }
      document.setDirty();

      return document;
    } finally {
      releaseExclusiveLock();
    }
  }
1095330
def _writeclientdoc(doc, thing, forceload=0):
    
    docmodule = pydoc.HTMLDoc.docmodule
    def strongarm(self, object, name=None, mod=None, *ignored):
        result = docmodule(self, object, name, mod, *ignored)

        # Grab all the aliases to pyclasses and create links.
        nonmembers = []
        push = nonmembers.append
        for k,v in inspect.getmembers(object, inspect.isclass):
            if inspect.getmodule(v) is not object and getattr(v,'typecode',None) is not None:
                push('<a href="%s.html">%s</a>: pyclass alias<br/>' %(v.__name__,k))

        result += self.bigsection('Aliases', '#ffffff', '#eeaa77', ''.join(nonmembers))
        return result

    pydoc.HTMLDoc.docmodule = strongarm
    try:
        object, name = pydoc.resolve(thing, forceload)
        page = pydoc.html.page(pydoc.describe(object), pydoc.html.document(object, name))
        name = os.path.join(doc, name + '.html')
        file = open(name, 'w')
        file.write(page)
        file.close()
    except (ImportError, pydoc.ErrorDuringImport), value:
        log.debug(str(value))

    pydoc.HTMLDoc.docmodule = docmodule
676402
def create_doc_jar(self, target, open_jar, version):
    """"""
    javadoc = self._java_doc(target)
    scaladoc = self._scala_doc(target)
    if javadoc or scaladoc:
      jar_path = self.artifact_path(open_jar, version, suffix='-javadoc')
      with self.open_jar(jar_path, overwrite=True, compressed=True) as open_jar:
        def add_docs(docs):
          if docs:
            for basedir, doc_files in docs.items():
              for doc_file in doc_files:
                open_jar.write(os.path.join(basedir, doc_file), doc_file)

        add_docs(javadoc)
        add_docs(scaladoc)
      return jar_path
    else:
      return None
417389
protected void generateInnerDocumentationAdapter() {
		final TypeReference adapter = getCodeElementExtractor().getInnerBlockDocumentationAdapter();
		final StringConcatenationClient content = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation it) {
				it.append("public class "); //$NON-NLS-1$
				it.append(adapter.getSimpleName());
				it.append(" extends "); //$NON-NLS-1$
				it.append(AdapterImpl.class);
				it.append(" {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tprivate String documentation;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic String getDocumentation() {"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t\treturn this.documentation;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\tpublic void setDocumentation(String documentation) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\tthis.documentation = documentation;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("\t@"); //$NON-NLS-1$
				it.append(Pure.class);
				it.newLine();
				it.append("\tpublic boolean isAdapterForType(Object type) {"); //$NON-NLS-1$
				it.newLine();
				it.append("\t\treturn type == "); //$NON-NLS-1$
				it.append(adapter.getSimpleName());
				it.append(".class;"); //$NON-NLS-1$
				it.newLine();
				it.append("\t}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
				it.newLine();
				it.append("}"); //$NON-NLS-1$
				it.newLineIfNotEmpty();
			}

		};
		final JavaFileAccess createJavaFile = getFileAccessFactory().createJavaFile(adapter, content);
		createJavaFile.writeTo(getSrcGen());
	}
670714
public Writable newWritable(short writableTypeKey) {
        Constructor<? extends Writable> c = constructorMap.get(writableTypeKey);
        if (c == null) {
            throw new IllegalStateException("Unknown writable key: " + writableTypeKey);
        }
        try {
            return c.newInstance();
        } catch (Exception e) {
            throw new RuntimeException("Could not create new Writable instance");
        }
    }
663153
def javadoc_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
    

    has_explicit_title, title, target = split_explicit_title(text)
    title = utils.unescape(title)
    target = utils.unescape(target)

    if not has_explicit_title:
        target = target.lstrip('~')

        if title[0] == '~':
            title = title[1:].rpartition('.')[2]

    app = inliner.document.settings.env.app
    ref = get_javadoc_ref(app, rawtext, target)

    if not ref:
         raise ValueError("no Javadoc source found for %s in javadoc_url_map" % (target,))

    ref.append(nodes.Text(title, title))

    return [ref], []
59408
@Override
public RecordWriter<NullWritable,SpreadSheetCellDAO> getRecordWriter(TaskAttemptContext context) throws IOException {
	// check if mimeType is set. If not assume new Excel format (.xlsx)
	Configuration conf=context.getConfiguration();
	String defaultConf=conf.get(HadoopOfficeWriteConfiguration.CONF_MIMETYPE,ExcelFileOutputFormat.DEFAULT_MIMETYPE);
	conf.set(HadoopOfficeWriteConfiguration.CONF_MIMETYPE,defaultConf);
	// add suffix	
	Path file = getDefaultWorkFile(context,ExcelFileOutputFormat.getSuffix(conf.get(HadoopOfficeWriteConfiguration.CONF_MIMETYPE)));


	 	try {
			return new ExcelRecordWriter<>(HadoopUtil.getDataOutputStream(conf,file,context,getCompressOutput(context),getOutputCompressorClass(context, ExcelFileOutputFormat.defaultCompressorClass)),file.getName(),conf);
		} catch (InvalidWriterConfigurationException | InvalidCellSpecificationException | FormatNotUnderstoodException
				| GeneralSecurityException | OfficeWriterException e) {
			LOG.error(e);
		}

	return null;
}
1366019
def NewDoc(self, cur, URL, encoding, options):
        
        ret = libxml2mod.xmlReaderNewDoc(self._o, cur, URL, encoding, options)
        return ret
1042619
function reassignJavadoc(from, to) {
  if (!(from.doc instanceof Javadoc)) {
    // Nothing to transfer.
    return from;
  }
  to.doc = from.doc;
  delete from.doc;
  return Object.keys(from).length === 1 ? from.type : from;
}
1119020
def createDocument(self, nsuri, qname, doctype=None):
        """"""
        impl = xml.dom.minidom.getDOMImplementation()
        return impl.createDocument(nsuri, qname, doctype)
301818
public static void writeWritablesToFile(String outputPath, String delim, List<List<Writable>> writables,
                    JavaSparkContext sc) throws IOException {
        StringBuilder sb = new StringBuilder();
        for (List<Writable> list : writables) {
            boolean first = true;
            for (Writable w : list) {
                if (!first)
                    sb.append(delim);
                sb.append(w.toString());
                first = false;
            }
            sb.append("\n");
        }
        writeStringToFile(outputPath, sb.toString(), sc);
    }