class_docstr: Queue with Binary Indexed Tree cache
  
  queue-like data structure
  append, update are O(log n)
  reduction over an interval is O(log n) per query
class_docstr_tok: ["Queue","with","Binary","Indexed","Tree","cache","queue-like","data","structure","append",",","update","are","O","(","log","n",")","reduction","over","an","interval","is","O","(","log","n",")","per","query"]
code: def append(self, value: V) -> None:
      if self.length == 0:
          self.root = [None, None, value]
          self.bounds = 0, 1
          self.length = 1
          return
  
      ixl, ixr = self.bounds
      root = self.root
      if ixr == self.length:
          _, _, root_value = root
          self.root = [self.root, [], root_value]
          ixr += ixr - ixl
          self.bounds = ixl, ixr
      ret = self._write(self.length, value)
      assert ret is None
      self.length += 1
  
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 4 for calling the TreeQueue obj's underlying member method code with example usage: obj.append(value) without return types