def get_transitions(self, indexes, history_length=<NUM_LIT:1>):
frame_batch_shape = (<EOL>[indexes.shape[<NUM_LIT:0>]]<EOL>+ list(self.state_buffer.shape[<NUM_LIT:1>:-<NUM_LIT:1>])<EOL>+ [self.state_buffer.shape[-<NUM_LIT:1>] * history_length]<EOL>)<EOL>past_frame_buffer = np.zeros(frame_batch_shape, dtype=self.state_buffer.dtype)<EOL>future_frame_buffer = np.zeros(frame_batch_shape, dtype=self.state_buffer.dtype)<EOL>for buffer_idx, frame_idx in enumerate(indexes):<EOL><INDENT>past_frame_buffer[buffer_idx], future_frame_buffer[buffer_idx] = self.get_frame_with_future(<EOL>frame_idx, history_length<EOL>)<EOL><DEDENT>actions = self.action_buffer[indexes]<EOL>rewards = self.reward_buffer[indexes]<EOL>dones = self.dones_buffer[indexes]<EOL>data_dict = {<EOL>'<STR_LIT>': past_frame_buffer,<EOL>'<STR_LIT>': actions,<EOL>'<STR_LIT>': rewards,<EOL>'<STR_LIT>': future_frame_buffer,<EOL>'<STR_LIT>': dones,<EOL>}<EOL>for name in self.extra_data:<EOL><INDENT>data_dict[name] = self.extra_data[name][indexes]<EOL><DEDENT>return data_dict<EOL>
Return batch with given indexes