code: def test_tree_set():
      tree = SumSegmentTree(4)
  
      tree[2] = 1.0
      tree[3] = 3.0
  
      assert np.isclose(tree.sum(), 4.0)
      assert np.isclose(tree.sum(0, 2), 0.0)
      assert np.isclose(tree.sum(0, 3), 1.0)
      assert np.isclose(tree.sum(2, 3), 1.0)
      assert np.isclose(tree.sum(2, -1), 1.0)
      assert np.isclose(tree.sum(2, 4), 4.0)
  
imports: import numpy
  from baselines.common.segment_tree import SumSegmentTree, MinSegmentTree
label_desc: Use image node_id 1 for calling a global function with example usage: test_tree_set() without return types