def sample(self, batch_size, batch_idxs=None):
if batch_idxs is None:<EOL><INDENT>batch_idxs = sample_batch_indexes(<NUM_LIT:0>, self.nb_entries, size=batch_size)<EOL><DEDENT>assert len(batch_idxs) == batch_size<EOL>batch_params = []<EOL>batch_total_rewards = []<EOL>for idx in batch_idxs:<EOL><INDENT>batch_params.append(self.params[idx])<EOL>batch_total_rewards.append(self.total_rewards[idx])<EOL><DEDENT>return batch_params, batch_total_rewards<EOL>
Return a randomized batch of params and rewards

        # Argument
            batch_size (int): Size of the all batch
            batch_idxs (int): Indexes to extract
        # Returns
            A list of params randomly selected and a list of associated rewards