code: def __setitem__(self, idx, val):
      # indexes of the leaf
      idxs = idx + self._capacity
      self._value[idxs] = val
      if isinstance(idxs, int):
          idxs = np.array([idxs])
      # go up one level in the tree and remove duplicate indexes
      idxs = unique(idxs // 2)
      while len(idxs) > 1 or idxs[0] > 0:
          # as long as there are non-zero indexes, update the corresponding values
          self._value[idxs] = self._operation(
              self._value[2 * idxs], self._value[2 * idxs + 1]
          )
          # go up one level in the tree and remove duplicate indexes
          idxs = unique(idxs // 2)
  
file_path: stable-baselines/stable_baselines/common/segment_tree.py
imports: import numpy
label_desc: Use image node_id 4 for calling the SegmentTree obj's underlying member method code with example usage: obj.__setitem__(idx, val) without return types