<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_transition(self, frame_idx, env_idx):
 """ Single transition with given index """

        past_frame, future_frame = self.get_frame_with_future(frame_idx, env_idx)

        data_dict = {
            'observations': past_frame,
            'observations_next': future_frame,
            'actions': self.action_buffer[frame_idx, env_idx],
            'rewards': self.reward_buffer[frame_idx, env_idx],
            'dones': self.dones_buffer[frame_idx, env_idx],
        }

        for name in self.extra_data:
            data_dict[name] = self.extra_data[name][frame_idx, env_idx]

        return data_dict