def observe(self, terminal, reward, index=<NUM_LIT:0>):
self.current_terminal = terminal<EOL>self.current_reward = reward<EOL>if self.batched_observe:<EOL><INDENT>self.observe_terminal[index].append(self.current_terminal)<EOL>self.observe_reward[index].append(self.current_reward)<EOL>if self.current_terminal or len(self.observe_terminal[index]) >= self.batching_capacity:<EOL><INDENT>self.episode = self.model.observe(<EOL>terminal=self.observe_terminal[index],<EOL>reward=self.observe_reward[index],<EOL>index=index<EOL>)<EOL>self.observe_terminal[index] = list()<EOL>self.observe_reward[index] = list()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.episode = self.model.observe(<EOL>terminal=self.current_terminal,<EOL>reward=self.current_reward<EOL>)<EOL><DEDENT>
Observe experience from the environment to learn from. Optionally pre-processes rewards
Child classes should call super to get the processed reward
EX: terminal, reward = super()...

Args:
    terminal (bool): boolean indicating if the episode terminated after the observation.
    reward (float): scalar reward that resulted from executing the action.