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 uniform_sample(
      self, n: int, remove: bool
  ) -> Tuple[List[int], List[float]]:
      assert n >= 0
      ixs = list(sample_n_k(self.length, n))
      vals: List[float] = []
      if n > 0:
          for ix in ixs:
              val = self._write(ix, 0.0)
              assert val is not None
              vals.append(val)
  
      if not remove:
          for ix, val in zip(ixs, vals):
              self._write(ix, val)
  
      return ixs, vals
  
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 3 for calling the SumTreeQueue obj's underlying member method code with example usage: obj.uniform_sample(n, remove) and returns: ixs,  vals