code: def convert_to_tree(r_list, i_left, i_right, tgt_vocab):
      t = Tree()
      level = 0
      left = -1
      for i in range(i_left, i_right):
          if r_list[i] == tgt_vocab.get_symbol_idx("("):
              if level == 0:
                  left = i
              level = level + 1
          elif r_list[i] == tgt_vocab.get_symbol_idx(")"):
              level = level - 1
              if level == 0:
                  if i == left + 1:
                      c = r_list[i]
                  else:
                      c = Tree.convert_to_tree(
                          r_list, left + 1, i, tgt_vocab
                      )
                  t.add_child(c)
          elif level == 0:
              t.add_child(r_list[i])
      return t
  
imports: from operator import itemgetter
  import numpy
label_desc: Use image node_id 9 for calling the Tree obj's underlying member method code with example usage: obj.convert_to_tree(r_list, i_left, i_right, tgt_vocab) and returns: t