class_docstr: Fast weighted sampling.
  
  list-like data structure
  append, update are O(log n)
  summation over an interval is O(log n) per query
class_docstr_tok: ["Fast","weighted","sampling",".","list-like","data","structure","append",",","update","are","O","(","log","n",")","summation","over","an","interval","is","O","(","log","n",")","per","query"]
code: def __init__(self, bd=None, left=None, right=None, s=0.0):
      # bounds, left child, right child, sum
      self.bd = bd
      self.left = left
      self.right = right
      self.s = s
  
imports: import collections
  import numpy
  from chainerrl.misc.random import sample_n_k
label_desc: Use image node_id 1 to create a new SumTree object from inherited base classes: object with example: obj = SumTree(bd, left, right, s)