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 _write(self, ix, val):
      if self._isleaf():
          self.s = val
      else:
          c = self._center()
          if ix < c:
              self.left._write(ix, val)
          else:
              self.right._write(ix, val)
          self.s = self.left.s + self.right.s
  
imports: import collections
  import numpy
  from chainerrl.misc.random import sample_n_k
label_desc: Use image node_id 9 for calling the SumTree obj's underlying member method code with example usage: obj._write(ix, val) without return types