class_docstr: A tree which can be used as a min/max heap or a sum tree
  Add or update item value - O(log N)
  Sampling an item - O(log N)
docstr: Update the value of the node at index idx
  :param leaf_idx: the index of the node to update
  :param new_val: the new value of the node
  :return: None
docstr_tok: ["Update","the","value","of","the","node","at","index","idx",":","param","leaf_idx",":","the","index","of","the","node","to","update",":","param","new_val",":","the","new","value","of","the","node",":","return",":","None"]
code: def update(self, leaf_idx: int, new_val: float) -> None:
      """
      Update the value of the node at index idx
      :param leaf_idx: the index of the node to update
      :param new_val: the new value of the node
      :return: None
      """
      node_idx = leaf_idx + self.size - 1
      if not 0 <= node_idx < len(self.tree):
          raise ValueError(
              "The given left index ({}) can not be found in the tree. The available leaves are: 0-{}".format(
                  leaf_idx, self.size - 1
              )
          )
  
      self.tree[node_idx] = new_val
      self._propagate(node_idx)
  
imports: import operator
  import random
  from enum import Enum
  from typing import List, Tuple, Any
  import numpy
  from rl_coach.core_types import Transition
  from rl_coach.memories.memory import MemoryGranularity
  from rl_coach.memories.non_episodic.experience_replay import ExperienceReplayParameters, ExperienceReplay
  from rl_coach.schedules import Schedule, ConstantSchedule
label_desc: Use image node_id 6 for calling the SegmentTree obj's underlying member method code with example usage: obj.update(leaf_idx, new_val) without return types