def _update_state(self, response):
        """Update the state of the browser. Create a new state object, and
        append to or overwrite the browser's state history.

        :param requests.MockResponse: New response object

        """
        # Clear trailing states
        self._states = self._states[:self._cursor + 1]

        # Append new state
        state = RoboState(self, response)
        self._states.append(state)
        self._cursor += 1

        # Clear leading states
        if self._maxlen:
            decrement = len(self._states) - self._maxlen
            if decrement > 0:
                self._states = self._states[decrement:]
                self._cursor -= decrement
def _update_state ( self , response ) : self . _states = self . _states [ : self . _cursor + 1 ] state = RoboState ( self , response ) self . _states . append ( state ) self . _cursor += 1 if self . _maxlen : decrement = len ( self . _states ) - self . _maxlen if decrement > 0 : self . _states = self . _states [ decrement : ] self . _cursor -= decrement
Update the state of the browser. Create a new state object, and
        append to or overwrite the browser's state history.

        :param requests.MockResponse: New response object