class_docstr: a ring buffer for storing transitions and sampling for training
  :state: (state_dim,)
  :action: (action_dim,)
  :reward: (,), scalar
  :next_state: (state_dim,)
  :done: (,), scalar (0 and 1) or bool (True and False)
class_docstr_tok: ["a","ring","buffer","for","storing","transitions","and","sampling","for","training",":","state",":","(","state_dim",",",")",":","action",":","(","action_dim",",",")",":","reward",":","(",",",")",",","scalar",":","next_state",":","(","state_dim",",",")",":","done",":","(",",",")",",","scalar","(","0","and","1",")","or","bool","(","True","and","False",")"]
code: def sample(self, BATCH_SIZE):
      batch = random.sample(self.buffer, BATCH_SIZE)
      state, action, reward, next_state, done = map(
          np.stack, zip(*batch)
      )  # stack for each element
      """ 
          the * serves as unpack: sum(a,b) <=> batch=(a,b), sum(*batch) ;
          zip: a=[1,2], b=[2,3], zip(a,b) => [(1, 2), (2, 3)] ;
          the map serves as mapping the function on each list element: map(square, [2,3]) => [4,9] ;
          np.stack((1,2)) => array([1, 2])
          """
      return state, action, reward, next_state, done
  
imports: import argparse
  import os
  import random
  import time
  import gym
  import matplotlib.pyplot
  import numpy
  import tensorflow
  import tensorflow_probability
  import tensorlayer
  from tensorlayer.layers import Dense
  from tensorlayer.models import Model
label_desc: Use image node_id 3 for calling the ReplayBuffer obj's underlying member method code with example usage: obj.sample(BATCH_SIZE) and returns: state,  action,  reward,  next_state,  done