<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def restore(self, drop=0):
 """ Restores the last savepoint. If ``drop`` is supplied and greater than zero, then that many savepoints are dropped, and the next savepoint is restored. :param drop: :type drop: int """

        assert(drop >= 0)
        while drop > 0:
            self._savepoints.pop()
            drop -= 1

        img = self._savepoints.pop()
        self.display(img)