def set_position(self, position):
        """Resets the buffer to a previous state.

        The contents of the thread JSON array and the client timestamp will be reset to whatever it was when
        `position` was invoked.

        @param position: The position to reset the buffer state to.
        """
        # The position value should by an array with three entries: the size, the client timestamp, and the number
        # of threads.  Since threads are always added one after another, it is sufficient just to truncate back to that
        # previous length.
        self.__current_size = position[0]
        self.__client_timestamp = position[1]
        assert(len(self.__threads) >= position[2])
        if position[2] < len(self.__threads):
            self.__threads = self.__threads[0:position[2]]
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/scalyr_client.py/PostFixBuffer.set_position/original