def get_frame(self, frame_idx, env_idx):
if frame_idx >= self.current_size:<EOL><INDENT>raise VelException("<STR_LIT>")<EOL><DEDENT>accumulator = []<EOL>last_frame = self.state_buffer[frame_idx, env_idx]<EOL>accumulator.append(last_frame)<EOL>for i in range(self.frame_history - <NUM_LIT:1>):<EOL><INDENT>prev_idx = (frame_idx - <NUM_LIT:1>) % self.buffer_capacity<EOL>if prev_idx == self.current_idx:<EOL><INDENT>raise VelException("<STR_LIT>")<EOL><DEDENT>elif self.dones_buffer[prev_idx, env_idx]:<EOL><INDENT>accumulator.append(np.zeros_like(last_frame))<EOL><DEDENT>else:<EOL><INDENT>frame_idx = prev_idx<EOL>accumulator.append(self.state_buffer[frame_idx, env_idx])<EOL><DEDENT><DEDENT>return np.concatenate(accumulator[::-<NUM_LIT:1>], axis=-<NUM_LIT:1>)<EOL>
Return frame from the buffer