Return the last draft entries.
772983
def get_draft_entries(number=5,
                      template='zinnia/tags/entries_draft.html'):
    
    return {'template': template,
            'entries': Entry.objects.filter(status=DRAFT)[:number]}
1303475
def _last(self, **spec):
        
        for record in self._entries(spec).order_by(orm.desc(model.Entry.local_date),
                                                   orm.desc(model.Entry.id))[:1]:
            return entry.Entry(record)
        return None
1203635
def get_collection(cls):
        """"""

        # By default the collection returned will be the published collection,
        # however if the `draft` flag has been set against the global context
        # (e.g `g`) then the collection returned will contain draft documents.

        if g.get('draft'):
            return getattr(
                cls.get_db(),
                '{collection}_draft'.format(collection=cls._collection)
                )

        return getattr(cls.get_db(), cls._collection)
427390
def newest(self):
        
        if self._order_by == 'newest':
            return self.first
        if self._order_by == 'oldest':
            return self.last
        return max(self.entries, key=lambda x: (x.date, x.id))
1108062
def last(self, callback=None, default=None):
        
        if callback is not None:
            for val in reversed(self.items):
                if callback(val):
                    return val

            return value(default)

        if len(self.items) > 0:
            return self.items[-1]
        else:
            return default
915795
def _entries_sorted(self):
        """"""
        return sorted(self.entries.values(), key=lambda e: (e.path, e.stage))
743909
@GuardedBy("evictionLock")
  void expireEntries() {
    long now = expirationTicker().read();
    expireAfterAccessEntries(now);
    expireAfterWriteEntries(now);
    expireVariableEntries(now);
  }
179728
def last_update_time(self) -> float:
        """"""
        stdout = self.stdout_interceptor
        stderr = self.stderr_interceptor

        return max([
            self._last_update_time,
            stdout.last_write_time if stdout else 0,
            stderr.last_write_time if stderr else 0,
        ])
795642
def sort_entries(self):
        """"""
        return sorted(self.data, key=self.sort_func, reverse=self.get_reverse())
752583
def get_last_date(self, field, filters_=[]):
        '''
            
        '''

        last_date = self.get_last_item_field(field, filters_=filters_)

        return last_date
1044788
def remove_last_entry(self):
        """"""
        self.current_beat -= 1.0 / self.bar[-1][1]
        self.bar = self.bar[:-1]
        return self.current_beat
1039699
JournalSegment<E> getLastSegment() {
    assertOpen();
    Map.Entry<Long, JournalSegment<E>> segment = segments.lastEntry();
    return segment != null ? segment.getValue() : null;
  }
581693
def last(self, skipna=None, keep_attrs=None):
        
        return self._first_or_last(duck_array_ops.last, skipna, keep_attrs)
987641
def last_written_time(self):
    """"""
    timestamp = self._pyregf_key.get_last_written_time_as_integer()
    if timestamp == 0:
      return dfdatetime_semantic_time.SemanticTime('Not set')

    return dfdatetime_filetime.Filetime(timestamp=timestamp)
609320
def get_last_lineno(node):
    """"""
    max_lineno = 0

    if hasattr(node, "lineno"):
        max_lineno = node.lineno

    for _, field in ast.iter_fields(node):
        if isinstance(field, list):
            for value in field:
                if isinstance(value, ast.AST):
                    max_lineno = max(max_lineno, get_last_lineno(value))

        elif isinstance(field, ast.AST):
            max_lineno = max(max_lineno, get_last_lineno(field))

    return max_lineno
584246
def last_written_time(self):
    """"""
    if not self._registry_key and self._registry:
      self._GetKeyFromRegistry()

    if not self._registry_key:
      return None

    return self._registry_key.last_written_time
814165
def get_last(self, num=10):
        
        max_item = self.get_max_item()
        urls = [urljoin(self.item_url, F"{i}.json") for i in range(
            max_item - num + 1, max_item + 1)]
        result = self._run_async(urls=urls)
        return [Item(r) for r in result if r]