def sample_frame_single_env(self, batch_size, forward_steps=<NUM_LIT:1>):
<EOL>if self.current_size < self.buffer_capacity:<EOL><INDENT>return np.random.choice(self.current_size - forward_steps, batch_size, replace=False)<EOL><DEDENT>else:<EOL><INDENT>candidate = np.random.choice(self.buffer_capacity, batch_size, replace=False)<EOL>forbidden_ones = (<EOL>np.arange(self.current_idx - forward_steps + <NUM_LIT:1>, self.current_idx + self.frame_history)<EOL>% self.buffer_capacity<EOL>)<EOL>while any(x in candidate for x in forbidden_ones):<EOL><INDENT>candidate = np.random.choice(self.buffer_capacity, batch_size, replace=False)<EOL><DEDENT>return candidate<EOL><DEDENT>
Return an in index of a random set of frames from a buffer, that have enough history and future