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 _dict(self):
      ret = dict()
      if self.bd is not None and self._isleaf():
          ret[self.bd[0]] = self.s
      if self.left:
          ret.update(self.left._dict())
      if self.right:
          ret.update(self.right._dict())
      return ret
  
imports: import collections
  import numpy
  from chainerrl.misc.random import sample_n_k
label_desc: Use image node_id 3 for calling the SumTree obj's underlying member method code with example usage: obj._dict() and returns: ret