docstr: 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
docstr_tok: ["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"]
code: def sample(self, batch_size, batch_idxs=None):
      """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
      """
      if batch_idxs is None:
          batch_idxs = sample_batch_indexes(
              0, self.nb_entries, size=batch_size
          )
      assert len(batch_idxs) == batch_size
  
      batch_params = []
      batch_total_rewards = []
      for idx in batch_idxs:
          batch_params.append(self.params[idx])
          batch_total_rewards.append(self.total_rewards[idx])
      return batch_params, batch_total_rewards
  
imports: from __future__ import absolute_import
  from collections import deque, namedtuple
  import warnings
  import random
  import numpy
label_desc: Use image node_id 2 for calling the EpisodeParameterMemory obj's underlying member method code with example usage: obj.sample(batch_size, batch_idxs) and returns: batch_params,  batch_total_rewards