code: def prev_page(self):
          
          if self.history.position > self.lines and self.history.top:
              mid = min(len(self.history.top),
                        int(math.ceil(self.lines * self.history.ratio)))
  
              self.history.bottom.extendleft(
                  self.buffer[y]
                  for y in range(self.lines - 1, self.lines - mid - 1, -1))
              self.history = self.history \
                  ._replace(position=self.history.position - mid)
  
              for y in range(self.lines - 1, mid - 1, -1):
                  self.buffer[y] = self.buffer[y - mid]
              for y in range(mid - 1, -1, -1):
                  self.buffer[y] = self.history.top.pop()
  
              self.dirty = set(range(self.lines))
docs: Move the screen page up through the history buffer. Page
          size is defined by ``history.ratio``, so for instance
          ``ratio = .5`` means that half the screen is restored from
          history on page switch.