Return a full tsdoc for a type.

@param doc the doc string in the type's DataSchema.
@param deprecation the object listed under the schema's "deprecation" property

@return a fully formed tsdoc for the type.
506723
private static String docComment(String doc, Object deprecation /* nullable */) {
    StringBuilder docStr = new StringBuilder();

    if (doc != null) {
      docStr.append(doc.trim());
    }

    if (deprecation != null) {
      docStr.append("\n\n").append("@deprecated");
      if (deprecation instanceof String) {
        docStr.append("  ").append(((String)deprecation).trim());
      }
    }
    return DocEscaping.stringToDocComment(docStr.toString(), DocCommentStyle.ASTRISK_MARGIN);
  }
1007633
def generate_documentation(schema):
    

    documentation_title = "Configuration documentation"
    documentation = documentation_title + "\n"
    documentation += "=" * len(documentation_title) + '\n'

    for section_name in schema:
        section_created = False

        for option_name in schema[section_name]:

            option = schema[section_name][option_name]

            if not section_created:
                documentation += '\n'
                documentation += section_name + '\n'
                documentation += '-' * len(section_name) + '\n'
                section_created = True

            documentation += '\n'
            documentation += option_name + '\n'
            documentation += '~' * len(option_name) + '\n'

            if option.get('required'):

                documentation += "** This option is required! **\n"

            if option.get('type'):

                documentation += '*Type : %s.*\n' % option.get('type')

            if option.get('description'):

                documentation += option.get('description') + '\n'

            if option.get('default'):

                documentation += 'The default value is %s.\n' % option.get('default')

            if option.get('deprecated'):

                documentation += "** This option is deprecated! **\n"

    return documentation
1016261
function (doc) {
        [
            'Returns',
            'Emits',
            'Access',
            'Kind'
        ].forEach(function removeLine(preTag) {
            preTag = '**' + preTag;

            var start = doc.indexOf(preTag);
            if (start !== -1) {
                var end = doc.indexOf('\n', start) + 1;

                doc = doc.substring(0, start) + doc.substring(end);
            }
        });

        return doc;
    }
401432
public void setDocumentation(String doc) {
		if (Strings.isEmpty(doc)) {
			getSarlAnnotationType().eAdapters().removeIf(new Predicate<Adapter>() {
				public boolean test(Adapter adapter) {
					return adapter.isAdapterForType(DocumentationAdapter.class);
				}
			});
		} else {
			DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter(
					getSarlAnnotationType(), DocumentationAdapter.class);
			if (adapter == null) {
				adapter = new DocumentationAdapter();
				getSarlAnnotationType().eAdapters().add(adapter);
			}
			adapter.setDocumentation(doc);
		}
	}
193643
function(doc, fields) {
	return Object.keys(fields).reduce((prev, key) => {
		let val

		if (fields[key].hasOwnProperty('referenceCollection')) {
			const displayField = fields[key].referenceCollection.defaultField

			if (Array.isArray(doc[key])) {
				val = doc[key].map(data => {
					return data[displayField]
				})
			} else {
				val = doc[key][displayField]
			}
		} else {
			val = doc[key]
		}
		return Object.assign({}, prev, {
			[key]: val
		})
	}, { _id: doc._id })
}
27951
function typeToJsDocString(schema) {
  //console.log(schema.type);
  if (schema.docType) {
    return schema.docType;
  }
  
  if (typeof schema.type === 'string') {
    switch (schema.type) {
      /* TODO Implement as @callback
      case 'Function':
      case 'function':
        if (schema.doc && schema.doc.parameters) {
          return 'function'; // + (Object.keys(schema.doc.parameters)).join(', ')
          //    + ')';
        } else {
          return 'function';
        }*/
      case 'any':
        return '*';
      default:
        return schema.type;
    }
  } else if (schema.type === null) {
    return 'schema';
  } else if (schema.type instanceof Object) {
    return 'Object';
  }
}
210651
def encode_document(obj):
    """"""
    warnings.warn("deprecated. Please use bioc.biocxml.encoder.encode_document", DeprecationWarning)
    return bioc.biocxml.encoder.encode_document(obj)
51921
def get_doc(self, objtxt):
        """"""
        obj, valid = self._eval(objtxt)
        if valid:
            return getdoc(obj)
1286603
static public DocAndReserved computeDocAndReservedFromDocument(JSONObject doc) throws Exception {
		DocAndReserved result = new DocAndReserved();
		
		result.doc = new JSONObject();
		result.reserved = new JSONObject();

		if( null != doc ) {
			Iterator<?> it = doc.keys();
			while( it.hasNext() ){
				Object keyObj = it.next();
				if( keyObj instanceof String ){
					String key = (String)keyObj;
					Object value = doc.opt(key);
					
					if( key.startsWith("_") ){
						String effectiveKey = key.substring(1);
						result.reserved.put(effectiveKey, value);
					} else {
						result.doc.put(key, value);
					}
				}
			}
		}
		
		return result;
	}
490417
function doc_builder(doc) {
				if(is.array(doc)) {
					return ARRAY(doc).map(_doc_builder).valueOf();
				}
				return _doc_builder(doc);
			}
114853
def update_docstring(dispatcher, func=None):
    
    doc = dispatcher.__doc__ or ''
    if inspect.cleandoc(doc).startswith('%s(' % dispatcher.__name__):
        return
    sig = '(...)'
    if func and func.__code__.co_argcount:
        argspec = inspect.getfullargspec(func) # pylint: disable=deprecated-method
        if argspec.args and argspec.args[0] in {'self', 'cls'}:
            argspec.args.pop(0)
        if any(argspec):
            sig = inspect.formatargspec(*argspec) # pylint: disable=deprecated-method
            sig = re.sub(r' at 0x[0-9a-f]{8,16}(?=>)', '', sig)
    sep = '\n' if doc.startswith('\n') else '\n\n'
    dispatcher.__doc__ = dispatcher.__name__ + sig + sep + doc
798588
@Deprecated
    @Programmatic
    public boolean canCreateDocumentAndAttachPaperclips(
            final Object domainObject,
            final DocumentTemplate template) {
        final AttachmentAdvisor attachmentAdvisor = template.newAttachmentAdvisor(domainObject);
        return attachmentAdvisor != null;
    }
249871
public static String documentToPrettyString(Document document) {
        StringWriter stringWriter = new StringWriter();
        OutputFormat prettyPrintFormat = OutputFormat.createPrettyPrint();
        XMLWriter xmlWriter = new XMLWriter(stringWriter, prettyPrintFormat);

        try {
            xmlWriter.write(document);
        } catch (IOException e) {
            // Ignore, shouldn't happen.
        }

        return stringWriter.toString();
    }
1201334
def get_deprecation_reason(
    node: Union[EnumValueDefinitionNode, FieldDefinitionNode]
) -> Optional[str]:
    """"""
    from ..execution import get_directive_values

    deprecated = get_directive_values(GraphQLDeprecatedDirective, node)
    return deprecated["reason"] if deprecated else None
1262286
def get_doctypes(self, default_doctypes=None):
        """"""
        doctypes = self.type.get_mapping_type_name()
        if isinstance(doctypes, six.string_types):
            doctypes = [doctypes]
        return super(S, self).get_doctypes(default_doctypes=doctypes)
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;
    }
  }
432309
private static DocumentType getDocType(final InputStream body)
        throws IOException {
        final DocumentBuilderFactory factory =
            DocumentBuilderFactory.newInstance();
        try {
            factory.setFeature(RsPrettyXml.LOAD_EXTERNAL_DTD, false);
            final DocumentBuilder builder = factory.newDocumentBuilder();
            return builder.parse(body).getDoctype();
        } catch (final ParserConfigurationException | SAXException ex) {
            throw new IOException(ex);
        }
    }