def get_recent_state(self, current_observation):
        """Return list of last observations

        # Argument
            current_observation (object): Last observation

        # Returns
            A list of the last observations
        """
        # This code is slightly complicated by the fact that subsequent observations might be
        # from different episodes. We ensure that an experience never spans multiple episodes.
        # This is probably not that important in practice but it seems cleaner.
        state = [current_observation]
        idx = len(self.recent_observations) - 1
        for offset in range(0, self.window_length - 1):
            current_idx = idx - offset
            current_terminal = self.recent_terminals[current_idx - 1] if current_idx - 1 >= 0 else False
            if current_idx < 0 or (not self.ignore_episode_boundaries and current_terminal):
                # The previously handled observation was terminal, don't add the current one.
                # Otherwise we would leak into a different episode.
                break
            state.insert(0, self.recent_observations[current_idx])
        while len(state) < self.window_length:
            state.insert(0, zeroed_observation(state[0]))
        return state
def get_recent_state ( self , current_observation ) : state = [ current_observation ] idx = len ( self . recent_observations ) - 1 for offset in range ( 0 , self . window_length - 1 ) : current_idx = idx - offset current_terminal = self . recent_terminals [ current_idx - 1 ] if current_idx - 1 >= 0 else False if current_idx < 0 or ( not self . ignore_episode_boundaries and current_terminal ) : break state . insert ( 0 , self . recent_observations [ current_idx ] ) while len ( state ) < self . window_length : state . insert ( 0 , zeroed_observation ( state [ 0 ] ) ) return state
Return list of last observations

        # Argument
            current_observation (object): Last observation

        # Returns
            A list of the last observations