code: def split_underscores(tree):
      assert (
          not tree.is_leaf()
      ), "Should never reach a leaf in this code path"
  
      if tree.is_preterminal():
          return tree
  
      children = tree.children
      new_children = []
      for child in children:
          if child.is_preterminal():
              if "_" not in child.children[0].label:
                  new_children.append(child)
                  continue
  
              if child.label.split("-")[0] not in WORD_TO_PHRASE:
                  raise ValueError("SPLITTING {}".format(child))
              pieces = []
              for piece in child.children[0].label.split("_"):
                  # This may not be accurate, but we already retag the treebank anyway
                  if len(piece) == 0:
                      raise ValueError("A word started or ended with _")
                  pieces.append(Tree(child.label, Tree(piece)))
              new_children.append(
                  Tree(
                      WORD_TO_PHRASE[child.label.split("-")[0]], pieces
                  )
              )
          else:
              new_children.append(split_underscores(child))
  
      return Tree(tree.label, new_children)
  
file_path: stanza/stanza/utils/datasets/constituency/convert_arboretum.py
imports: from collections import namedtuple
  import io
  import xml.etree.ElementTree
  from tqdm import tqdm
  from stanza.models.constituency.parse_tree import Tree
  from stanza.server import tsurgeon
label_desc: Use image node_id 7 for calling a global function with example usage: split_underscores(tree) and returns: Tree, tree