Return the most recently parsed list of ``Documents``.

        :rtype: A list of the most recently parsed ``Documents`` ordered by name.
540300
def get_last_documents(self):
        
        return (
            self.session.query(Document)
            .filter(Document.name.in_(self.last_docs))
            .order_by(Document.name)
            .all()
        )
1150188
def sorted_names(names):
    
    names = list(names)

    have_default = False
    if 'default' in names:
        names.remove('default')
        have_default = True

    sorted_names = sorted(names)

    if have_default:
        sorted_names = ['default'] + sorted_names

    return sorted_names
1025286
def recent(self):
        '''
        
        '''
        kwd = {
            'pager': '',
            'title': 'Recent Pages',
        }
        self.render('wiki_page/wiki_list.html',
                    view=MWiki.query_recent(),
                    format_date=tools.format_date,
                    kwd=kwd,
                    userinfo=self.userinfo)
463429
def document_ids(self):
        """"""
        matches = [PCC_DOCID_RE.match(os.path.basename(fname))
                   for fname in pcc.tokenization]
        return sorted(match.groups()[0] for match in matches)
622860
def proceed(self):
        
        self._parse()
        for e in self.docs_list:
            e['docs'].generate_docs()
        return self.docs_list
1349348
def documents(cls, filter=None, **kwargs):
        
        documents = [cls(document) for document in cls.find(filter, **kwargs)]
        return [document for document in documents if document.document]
746315
def _get_last_entries(db, qty):
    """"""
    doc_ids = [post.doc_id for post in db.posts.all()]
    doc_ids = sorted(doc_ids, reverse=True)
    # bug: here we shoud only render doc_ids[:qty]
    # but we can't use mtimes for sorting. We'll need to add ptime for the
    # database (publish time)
    entries = [Entry(os.path.join(CONFIG['content_root'],
                     db.posts.get(doc_id=doc_id)['filename']), doc_id)
               for doc_id in doc_ids]
    # return _sort_entries(entries)[:qty]
    entries.sort(key=operator.attrgetter('date'), reverse=True)
    return entries[:qty], entries
1008589
def get_list(self):
        
        field = self.FIELD_NAME
        query = ElasticQuery.get_agg(field=field,
                                     date_field=self.FIELD_DATE,
                                     start=self.start, end=self.end,
                                     filters=self.esfilters)
        logger.debug("Metric: '%s' (%s); Query: %s",
                     self.name, self.id, query)
        res = self.get_metrics_data(query)
        list_ = {field: [], "value": []}
        for bucket in res['aggregations'][str(ElasticQuery.AGGREGATION_ID)]['buckets']:
            list_[field].append(bucket['key'])
            list_['value'].append(bucket['doc_count'])
        return list_
907923
def recent(category=None, pages=1, sort=None, order=None):
	""""""
	s = Search()
	s.recent(category, pages, sort, order)
	return s
1151242
def __get_name(self):
        
        if self.is_new:
            return _("New document")
        try:
            split = self.__docid.split("_")
            short_docid = "_".join(split[:3])
            datetime_obj = datetime.datetime.strptime(
                short_docid, self.DOCNAME_FORMAT)
            final = datetime_obj.strftime("%x")
            return final
        except Exception as exc:
            logger.error("Unable to parse document id [%s]: %s"
                         % (self.docid, exc))
            return self.docid
1118468
def get_top_tags(self, limit=None, cacheable=True):
        

        params = self._get_params()
        if limit:
            params["limit"] = limit

        doc = self._request(self.ws_prefix + ".getTopTags", cacheable, params)

        seq = []
        for node in doc.getElementsByTagName("tag"):
            seq.append(
                TopItem(
                    Tag(_extract(node, "name"), self.network), _extract(node, "count")
                )
            )

        return seq
279643
def get_most_recent_update_time(self):
        
        def parse_time(t):
            if t:
                return time.gmtime(t/1000)
            return None
        try:
            max_wf_started_at = max([i.get('startedAt') for i in self.workflowHistory])
            return parse_time(max_wf_started_at)
        except ValueError:
            return None
892425
def list_records_previous_page(self):
        
        uri = self._paging.get("record", {}).get("prev_uri")
        if uri is None:
            raise exc.NoMoreResults("There are no previous pages of records "
                    "to list.")
        return self._list_records(uri)
1357662
def previous(self):
        '''  '''
        try:
            return self.__class__.objects.for_model(self.content_object,
                                                    self.content_type).\
                            filter(order__gt=self.order).order_by('order')[0]
        except IndexError:
            return None
599707
def get_last_doc(self):
        
        try:
            result = self.elastic.search(
                index=self.meta_index_name,
                body={
                    "query": {"match_all": {}},
                    "sort": [{"_ts": "desc"}],
                },
                size=1
            )["hits"]["hits"]
            for r in result:
                r['_source']['_id'] = r['_id']
                return r['_source']
        except es_exceptions.RequestError:
            # no documents so ES returns 400 because of undefined _ts mapping
            return None
324129
def parse_wiki_terms(doc):
    ''''''
    results = []
    last3 = ['', '', '']
    header = True
    for line in doc.split('\n'):
        last3.pop(0)
        last3.append(line.strip())
        if all(s.startswith('<td>') and not s == '<td></td>' for s in last3):
            if header:
                header = False
                continue
            last3 = [s.replace('<td>', '').replace('</td>', '').strip() for s in last3]
            rank, term, count = last3
            rank = int(rank.split()[0])
            term = term.replace('</a>', '')
            term = term[term.index('>')+1:].lower()
            results.append(term)
    assert len(results) in [1000, 2000, 1284] # early docs have 1k entries, later have 2k, last doc has 1284
    return results
700980
function() {
      var documents = [];
      // search localstorage for saved documents
      for ( var i = 0, max = localStorage.length; i < max; i++) {
        var key = localStorage.key(i);
        // value is a document if key confirms to prefix
        if (key.indexOf(prefix) == 0) {
          var doc = getDocumentByKey(key);
          if (doc) {
            documents.push(doc);
          }
        }
      }
      return documents;
    }