Returns a pair: (doc_id, nexson_blob)
        for each document in this repository.
        Order is arbitrary.
550837
def iter_doc_objs(self, **kwargs):
        
        _LOG = get_logger('TypeAwareGitShard')
        try:
            for doc_id, fp in self.iter_doc_filepaths(**kwargs):
                if not self._is_alias(doc_id):
                    # TODO:hook for type-specific parser?
                    with codecs.open(fp, 'r', 'utf-8') as fo:
                        try:
                            nex_obj = anyjson.loads(fo.read())
                            yield (doc_id, nex_obj)
                        except Exception:
                            pass
        except Exception as x:
            f = 'iter_doc_filepaths FAILED with this error:\n{}'
            f = f.format(str(x))
            _LOG.warn(f)
1122120
def get(self, collection, doc_id, **kwargs):
        

        resp, con_inf = self.transport.send_request(method='GET',
                                                    endpoint='get',
                                                    collection=collection,
                                                    params={'id': doc_id},
                                                    **kwargs)
        if 'doc' in resp and resp['doc']:
            return resp['doc']
        raise NotFoundError
447655
def get(self, document=None, plugin=None):
        
        if plugin is not None:
            if document is None:
                documents_list = {}
                for key in self.documents.keys():
                    if self.documents[key].plugin == plugin:
                        documents_list[key] = self.documents[key]
                return documents_list
            else:
                if document in self.documents.keys():
                    if self.documents[document].plugin == plugin:
                        return self.documents[document]
                    else:
                        return None
                else:
                    return None
        else:
            if document is None:
                return self.documents
            else:
                if document in self.documents.keys():
                    return self.documents[document]
                else:
                    return None
160503
def process_document(self, doc):
        

        raw = doc.select_segments("$.raw_content")[0]

        doc.store(doc.extract(self.content_extractor, raw, strategy=Strategy.ALL_TEXT), "etk2_text")
        doc.store(doc.extract(self.content_extractor, raw, strategy=Strategy.MAIN_CONTENT_STRICT),
                              "etk2_content_strict")
        doc.store(doc.extract(self.content_extractor, raw, strategy=Strategy.MAIN_CONTENT_RELAXED),
                              "etk2_content_relaxed")
        doc.store(doc.extract(self.metadata_extractor,
                              raw,
                              extract_title=True,
                              extract_meta=True,
                              extract_microdata=True,
                              extract_rdfa=True,
                              ), "etk2_metadata")
        return list()
522249
def get_documents_in_database(self, with_id=True):
        
        documents = []
        for coll in self.get_collection_names():
            documents += self.get_documents_in_collection(
                coll,
                with_id=with_id
            )

        return documents
778432
def get(self, obj_id):
        
        if BasicPage.PAGE_ID_SEPARATOR in obj_id:
            (docid, page_nb) = obj_id.split(BasicPage.PAGE_ID_SEPARATOR)
            page_nb = int(page_nb)
            return self._docs_by_id[docid].pages[page_nb]
        return self._docs_by_id[obj_id]
274267
def _get_blob(self):
        """"""
        if not self.__blob:
            self.__blob = self.repo.get_object(self.id)
        return self.__blob
1320476
def get_connective(docgraph, unit_id):
    
    unit_index, _unit_type = unit_id.split(':')
    connective_id = unit_index+':connective'
    return ' '.join(docgraph.get_token(tok_id).lower()
                    for tok_id in get_span(docgraph, connective_id))
406441
def sort_docs_by_key!
      meta_key = metadata["sort_by"]
      # Modify `docs` array to cache document's property along with the Document instance
      docs.map! { |doc| [doc.data[meta_key], doc] }.sort! do |apples, olives|
        order = determine_sort_order(meta_key, apples, olives)

        # Fall back to `Document#<=>` if the properties were equal or were non-sortable
        # Otherwise continue with current sort-order
        if order.zero? || order.nil?
          apples[-1] <=> olives[-1]
        else
          order
        end

        # Finally restore the `docs` array with just the Document objects themselves
      end.map!(&:last)
    end
783408
def from_pairs(cls, doc, pairs):
        
        values = (EnumItem(value, desc) for value, desc in pairs)
        return cls(doc=doc, values=values)
325568
def documents(self):
        
        if self._documents is None:
            self._documents = DocumentList(self._version, service_sid=self._solution['sid'], )
        return self._documents
793733
def path_for_doc(self, doc_id):
        
        full_path = self.path_for_doc_fn(self.repo, doc_id)
        # _LOG.debug('>>>>>>>>>> GitActionBase.path_for_doc_fn: {}'.format(self.path_for_doc_fn))
        # _LOG.debug('>>>>>>>>>> GitActionBase.path_for_doc returning: [{}]'.format(full_path))
        return full_path
1053737
def get_doctypes(self, index, edges=True):
        
        if index not in self.indices:
            self.get_all_indices()
        return self.indices.get(index, {})
646607
def get(self, id):
        
        data = self.fetch('documents/%s.json' % id).get("document")
        data['_connection'] = self._connection
        return Document(data)
1341665
def document(data)
      document = collaborative_model.find_by_collaborative_key(data['id'])

      @documents ||= []
      @documents << document

      send_attribute_versions(document)

      stream_from "loose_leaf.documents.#{document.id}.operations"
    end
924665
def parse_pandoc(self, attrs):
        """"""
        id = attrs[0]
        classes = attrs[1]
        kvs = OrderedDict(attrs[2])

        return id, classes, kvs
1047775
def get_document(self, doc_id):
        
        layer_graphs = []
        for layer_name in self.layers:
            layer_files, read_function = self.layers[layer_name]
            for layer_file in layer_files:
                if fnmatch.fnmatch(layer_file, '*{}.*'.format(doc_id)):
                    layer_graphs.append(read_function(layer_file))

        if not layer_graphs:
            raise TypeError("There are no files with that document ID.")
        else:
            doc_graph = layer_graphs[0]
            for layer_graph in layer_graphs[1:]:
                doc_graph.merge_graphs(layer_graph)
        return doc_graph