Get the previous item in any particular category
7629
def _previous(self, **kwargs):
        
        spec = self._pagination_default_spec(kwargs)
        spec.update(kwargs)

        query = queries.build_query(spec)
        query = queries.where_before_entry(query, self._record)

        for record in query.order_by(orm.desc(model.Entry.local_date),
                                     orm.desc(model.Entry.id))[:1]:
            return Entry(record)
        return None
572779
function getPreviousItem(opts: Options, value: Value, block?: Block): ?Block {
    const { document, startBlock } = value;
    block = block || startBlock;

    const currentItem = getCurrentItem(opts, value, block);
    if (!currentItem) {
        return null;
    }

    const previousSibling = document.getPreviousSibling(currentItem.key);

    if (!previousSibling) {
        return null;
    } else if (previousSibling.type === opts.typeItem) {
        return previousSibling;
    }
    return null;
}
976078
def old_values(self):
        ''''''
        def get_old_values_and_key(item):
            values = item.old_values
            values.update({self._key: item.past_dict[self._key]})
            return values

        return [get_old_values_and_key(el)
                for el in self._get_recursive_difference('all')
                if el.diffs and el.past_dict]
1273906
def last(self):
        
        if self.type == HoloMap:
            last_items = [(k, v.last if isinstance(v, HoloMap) else v)
                          for (k, v) in self.data.items()]
        else:
            last_items = self.data
        return self.clone(last_items)
452150
protected function getPrev()
    {
        if (!$this->current)
        {
            return null;
        }
        if ($this->prev !== -1)
        {
            return $this->prev;
        }
        $this->load();
        for ($i = 0; $i < count($this->items); $i++)
        {
            if ($this->items[$i]->id == $this->current->id)
            {
                if ($i > 0)
                {
                    $this->prev = $this->items[$i - 1];
                    return $this->prev;
                }
                break;
            }
        }
        return null;
    }
577409
def select_previous(self):
        """"""
        self.footer.clear_message()

        if self.selected == 0:
            self.footer.draw_message("Cannot move beyond first toot.", Color.GREEN)
            return

        old_index = self.selected
        new_index = self.selected - 1

        self.selected = new_index
        self.redraw_after_selection_change(old_index, new_index)
1355841
def get_last(self):
        """"""
        response = self.session.get(self.mission_url, verify=False)
        soup = BeautifulSoup(response.text, 'html.parser')
        last = soup.select('#Main div')[-1].text
        return last
440575
def dump_previous(self, obj):
        """"""
        if self._is_child(obj) and obj.index(self.context['pid']) > 0:
            return self._dump_relative(obj.previous_child(self.context['pid']))
541572
public function get_item_category() {
        if (!$this->is_course_item() and !$this->is_category_item()) {
            return false;
        }
        return grade_category::fetch(array('id'=>$this->iteminstance));
    }
581693
def last(self, skipna=None, keep_attrs=None):
        
        return self._first_or_last(duck_array_ops.last, skipna, keep_attrs)
1266254
def this_and_prev(iterable):
    """"""
    try:
        item = next(iterable)
        while True:
            next_item = next(iterable)
            yield item, next_item
            item = next_item
    except StopIteration:
        return
205817
public function getPrev()
    {
        return self::find()->where(['<', 'id', $this->id])->orderBy(['id' => SORT_DESC])->limit(1)->one();
    }
514501
def next(self):
        """"""
        rv = self.current
        self.pos = (self.pos + 1) % len(self.items)
        return rv
677479
def getPrevUrl(self, url, data):
        """"""
        prevUrl = None
        if self.prevSearch:
            try:
                prevUrl = self.fetchUrl(url, data, self.prevSearch)
            except ValueError as msg:
                # assume there is no previous URL, but print a warning
                out.warn(u"%s Assuming no previous comic strips exist." % msg)
            else:
                prevUrl = self.prevUrlModifier(prevUrl)
                out.debug(u"Found previous URL %s" % prevUrl)
                getHandler().comicPageLink(self.getName(), url, prevUrl)
        return prevUrl
718780
def get_by(self, name):
    """"""
    return next((item for item in self if item.name == name), None)
904903
def last_item(array):
    """"""
    if array.size == 0:
        # work around for https://github.com/numpy/numpy/issues/5195
        return []

    indexer = (slice(-1, None),) * array.ndim
    return np.ravel(array[indexer]).tolist()
963883
def getCategoryContent(self, category, excludeRead=False, continuation=None, loadLimit=20, since=None, until=None):
        
        return self._getFeedContent(category.fetchUrl, excludeRead, continuation, loadLimit, since, until)