Restores the previous position and returns the last move from the stack.

        :raises: :exc:`IndexError` if the stack is empty.
184909
def pop(self: BoardT) -> Move:
        
        move = self.move_stack.pop()
        self._stack.pop().restore(self)
        return move
1354970
def reset(self):
        
        self.stack.append(Frame(src=None, src_path=None))
        return Close(functools.partial(self.restore))
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
528379
function _movePrev() {
        var $context, $prev;

        $context = $currentContext || $("#mrof-container #mrof-list > li.highlight");
        if ($context.length > 0) {
            $prev = $context.prev();
            if ($prev.length === 0) {
                $prev = $("#mrof-container #mrof-list > li").last();
            }
            if ($prev.length > 0) {
                $currentContext = $prev;
                $prev.find("a.mroitem").trigger("focus");
            }
        } else {
            //WTF! (Worse than failure). We should not get here.
            $("#mrof-container #mrof-list > li > a.mroitem:visited").last().trigger("focus");
        }
    }
623379
def previous(self):
		
		if self.index - 1 >= 0:					# more main line?
			self.index = self.index - 1
		elif self.stack:						# were we in a variation?
			self.gametree = self.stack.pop()
			self.index = len(self.gametree) - 1
		else:
			raise GameTreeEndError
		self.node = self.gametree[self.index]
		self.nodenum = self.nodenum - 1
		self._setChildren()
		self._setFlags()
		return self.node
995030
def run(self, instance):
        

        last = instance

        for item in self.stack:
            if isinstance(item, str):
                last = getattr(last, item)
            else:
                last = last(*item[0], **item[1])

        self.stack = []
        return last
200401
def dup(self, position: int) -> None:
        
        idx = -1 * position
        try:
            self.push(self.values[idx])
        except IndexError:
            raise InsufficientStack("Insufficient stack items for DUP{0}".format(position))
622109
def complete_previous(self, count=1, disable_wrap_around=False):
        
        if self.complete_state:
            if self.complete_state.complete_index == 0:
                index = None

                if disable_wrap_around:
                    return
            elif self.complete_state.complete_index is None:
                index = len(self.complete_state.current_completions) - 1
            else:
                index = max(0, self.complete_state.complete_index - count)

            self.go_to_completion(index)
430822
def resetToPreviousLoc(self):
        
        self.rect.left = self.startDraggingX
        self.rect.top = self.startDraggingY
770486
function getGameAfterMoves(game, moves) {
    return moves.reduce(function (lastGame, move) {
        return getGameAfterMove(lastGame, move);
    }, game);
}
798596
def positions(self):
        
        # if accessing and stale - update first
        if self._needupdate:
            self.update(self.root.now)
        if self.root.stale:
            self.root.update(self.root.now, None)
        return self._positions.loc[:self.now]
127522
def extract_backtrace
      stack = caller
      while (first = stack.first) && first.include?(SELF_PATTERN)
        stack.shift
      end
      stack
    end
365268
def move_up(self):
        
        old_index = self.current_index
        self.current_index -= 1
        self.__wrap_index()
        self.__handle_selections(old_index, self.current_index)
1257734
def get_prev_step(self, step=None):
        
        if step is None:
            step = self.steps.current
        form_list = self.get_form_list()
        key = form_list.keyOrder.index(step) - 1
        if key >= 0:
            return form_list.keyOrder[key]
        return None
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)
369516
def sort(self):
        
        self.sorted = list()
        self.pushed = set()
        for item in self.unsorted:
            popped = []
            self.push(item)
            while len(self.stack):
                try:
                    top = self.top()
                    ref = next(top[1])
                    refd = self.index.get(ref)
                    if refd is None:
                        log.debug('"%s" not found, skipped', Repr(ref))
                        continue
                    self.push(refd)
                except StopIteration:
                    popped.append(self.pop())
                    continue
            for p in popped:
                self.sorted.append(p)
        self.unsorted = self.sorted
        return self.sorted
482063
def _last_stack_str():
    """"""
    stack = extract_stack()
    for s in stack[::-1]:
        if op.join('vispy', 'gloo', 'buffer.py') not in __file__:
            break
    return format_list([s])[0]