code: def test_max_tree():
      max_tree = SegmentTree(
          size=4, operation=SegmentTree.Operation.MAX
      )
      max_tree.add(10, "10")
      assert max_tree.total_value() == 10
      max_tree.add(20, "20")
      assert max_tree.total_value() == 20
      max_tree.add(5, "5")
      assert max_tree.total_value() == 20
      max_tree.add(7.5, "7.5")
      assert max_tree.total_value() == 20
      max_tree.add(2, "2")
      assert max_tree.total_value() == 20
      max_tree.add(3, "3")
      max_tree.add(3, "3")
      max_tree.add(3, "3")
      max_tree.add(5, "5")
      assert max_tree.total_value() == 5
  
      # update
      max_tree.update(1, 10)
      assert max_tree.total_value() == 10
      assert (
          max_tree.__str__() == "[10.]\n[10.  3.]\n[ 5. 10.  3.  3.]\n"
      )
      max_tree.update(1, 2)
      assert max_tree.total_value() == 5
      assert max_tree.__str__() == "[5.]\n[5. 3.]\n[5. 2. 3. 3.]\n"
  
imports: import os
  import sys
  import pytest
  from rl_coach.memories.non_episodic.prioritized_experience_replay import SegmentTree
label_desc: Use image node_id 3 for calling a global function with example usage: test_max_tree() without return types