docs is a list of fields that are a dictionary of name:value for a record.
333988
def add_docs(self, docs):
        """"""
        return self.query(
            'solr',
            '<add>{}</add>'.format(
                ''.join([self._format_add(fields) for fields in docs])
            ),
            do_post=True,
        )
80432
def _with_fields(*fields):
    
    dd = {}
    for x in fields:
        dd[x] = _COMMON_FIELDS[x]

    def wrap(cls):
        dd.update(cls.__dict__)
        return type(cls.__name__, cls.__bases__, dd)

    return wrap
1241133
private Map<String, Object> toFieldsMap(Map<String, DocumentField> fields) {
		Map<String, Object> result = new HashMap<>();
		for (Entry<String, DocumentField> entry : fields.entrySet()) {
			if (entry.getValue().getValues().size() > 1) {
				result.put(entry.getKey(), entry.getValue().getValues());
			} else {
				result.put(entry.getKey(), entry.getValue().getValue());
			}

		}
		return result;
	}
1146582
def documentation(self, add_to=None):
        """"""
        doc = OrderedDict if add_to is None else add_to

        usage = self.interface.spec.__doc__
        if usage:
            doc['usage'] = usage
        if getattr(self, 'requires', None):
            doc['requires'] = [getattr(requirement, '__doc__', requirement.__name__) for requirement in self.requires]
        doc['outputs'] = OrderedDict()
        doc['outputs']['format'] = self.outputs.__doc__
        doc['outputs']['content_type'] = self.outputs.content_type
        parameters = [param for param in self.parameters if not param in ('request', 'response', 'self')
                                                        and not param in ('api_version', 'body')
                                                        and not param.startswith('hug_')
                                                        and not hasattr(param, 'directive')]
        if parameters:
            inputs = doc.setdefault('inputs', OrderedDict())
            types = self.interface.spec.__annotations__
            for argument in parameters:
                kind = types.get(argument, text)
                if getattr(kind, 'directive', None) is True:
                    continue

                input_definition = inputs.setdefault(argument, OrderedDict())
                input_definition['type'] = kind if isinstance(kind, str) else kind.__doc__
                default = self.defaults.get(argument, None)
                if default is not None:
                    input_definition['default'] = default

        return doc
988491
def has_documented_fields(self, include_inherited_fields=False):
        """"""
        fields = self.all_fields if include_inherited_fields else self.fields
        for field in fields:
            if field.doc:
                return True
        return False
691232
def fields
      [
        ["Handle", :handle, proc { |v| v.to_hash }, :required],
        ["Id", :handle, proc { |v| v.id }, :required],
        ["DebtorHandle", :debtor, proc { |v| v.handle.to_hash }],
        ["Name", :name, nil, :required],
        ["Number", :number],
        ["TelephoneNumber", :telephone_number],
        ["Email", :email],
        ["Comments", :comments],
        ["ExternalId", :external_id],
        ["IsToReceiveEmailCopyOfOrder", :is_to_receive_email_copy_of_order, proc { |v| v || false }, :required],
        ["IsToReceiveEmailCopyOfInvoice", :is_to_receive_email_copy_of_invoice, proc { |v| v || false }, :required]
      ]
    end
323014
def prep_doc(self, doc_obj):
        
        doc = doc_obj._data.copy()
        for key, prop in list(doc_obj._base_properties.items()):
            prop.validate(doc.get(key), key)
            raw_value = prop.get_python_value(doc.get(key))
            if prop.unique:
                self.check_unique(doc_obj, key, raw_value)
            value = prop.get_db_value(raw_value)
            doc[key] = value

        doc['_doc_type'] = get_doc_type(doc_obj.__class__)
        return doc
455778
function gather() {
  var codes = {}
  var key

  for (key in doctypes) {
    codes[cleanDoctype(key)] = doctypes[key]
  }

  return codes
}
884672
def fields_for(record_name, record_object = nil, fields_options = {}, &block)
      hash  = {}
      array = []

      if nested_attributes_association?(record_name)
        hash["#{record_name}_attributes"] = fields_options[:signed_attributes_context] = array
      else
        hash[record_name] = fields_options[:signed_attributes_context] = array
      end

      add_signed_fields hash

      content = super
      array.uniq!
      content
    end
498425
def doc_params(**kwds):
    
    def dec(obj):
        obj.__doc__ = dedent(obj.__doc__).format(**kwds)
        return obj
    return dec
156280
function sortDocs(docs, sortType) {
    if (!sortType) return;
    const fnSorter = sorter.getSymbolsComparer(sortType, '$longname');
    const fnPropSorter = sorter.getSymbolsComparer(sortType, 'name');
    docs.sort(fnSorter);
    docs.forEach(symbol => {
        if (symbol && Array.isArray(symbol.properties)) {
            symbol.properties.sort(fnPropSorter);
        }
    });
}
1072519
def set_doc(self, doc: str):
        """"""
        self.__doc__ = doc
        if hasattr(self, 'module'):
            ref = f'{self.objtype.__name__}.{self.name}'
            self.module.__dict__['__test__'][ref] = doc
1197254
def iterateRecordInfos(dbid, query = nil, qid = nil, qname = nil, clist = nil, slist = nil, fmt = "structured", options = nil)
      getSchema(dbid)
      recordIDFieldName = lookupFieldNameFromID("3")
      fieldNames = getFieldNames
      fieldIDs = {}
      fieldNames.each{|name|fieldIDs[name] = lookupFieldIDByName(name)}
      iterateRecords(dbid, [recordIDFieldName], query, qid, qname, clist, slist, fmt, options){|r|
        getRecordInfo(dbid,r[recordIDFieldName])
        fieldValues = {}
        fieldIDs.each{|k,v| 
          fieldValues[k] = getFieldDataPrintableValue(v)
          fieldValues[k] ||= getFieldDataValue(v)
        }        
        yield fieldValues
      }
  end
743758
def setListDoc(self, doc):
        
        if doc is None: doc__o = None
        else: doc__o = doc._o
        libxml2mod.xmlSetListDoc(self._o, doc__o)
370515
def field_for(name, predicate, options)
      Tripod::Fields::Standard.new(name, predicate, options)
    end
554687
def get_document_field(instance):
        
        for name, field in instance.searchindex.fields.items():
            if field.document is True:
                return name
1010841
function identifyRefsInSchemaFields(structure, prefix) {

        _.each(structure.schema, (fieldStructure, fieldName) => {

            const name = prefix ? prefix + '.' + fieldName : fieldName;

            //If field has a schema, then it is a collection
            if (fieldStructure.schema) {

                // is this an object or an array?
                if (fieldStructure.meta && fieldStructure.meta.type === 'Array') {
                    //array
                    identifyRefsInSchemaFields(fieldStructure, name + '.*')
                } else {
                    //object. loop through schema.fields
                    identifyRefsInSchemaFields(fieldStructure, name)
                }

            } else if (fieldStructure.meta && fieldStructure.meta.ref) {
                //ref field found!
                refFields[name] = 1;
            }
        });


    }