class_docstr: Fast weighted sampling.
  
  queue-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",".","queue-like","data","structure","append",",","update","are","O","(","log","n",")","summation","over","an","interval","is","O","(","log","n",")","per","query"]
code: def sum(self) -> float:
      if self.length == 0:
          return 0.0
      else:
          return self.root[2]
  
imports: import collections
  from typing import Any, Callable, Deque, Generic, List, Optional, Sequence, Tuple, TypeVar
  import numpy
  from pfrl.utils.random import sample_n_k
label_desc: Use image node_id 2 for calling the SumTreeQueue obj's underlying member method code with example usage: obj.sum() and returns: int, self