code: def read_single_tree(token_iterator, broken_ok):
      """
      Build a tree from the tokens in the token_iterator
      """
      # we were called here at a open paren, so start the stack of
      # children with one empty list already on it
      children_stack = deque()
      children_stack.append([])
      text_stack = deque()
      text_stack.append([])
  
      token = next(token_iterator, None)
      token_iterator.set_mark()
      while token is not None:
          if token == OPEN_PAREN:
              children_stack.append([])
              text_stack.append([])
          elif token == CLOSE_PAREN:
              text = text_stack.pop()
              children = children_stack.pop()
              if text:
                  pieces = " ".join(text).split()
                  if len(pieces) == 1:
                      child = Tree(pieces[0], children)
                  else:
                      # the assumption here is that a language such as VI may
                      # have spaces in the words, but it still represents
                      # just one child
                      label = pieces[0]
                      child_label = " ".join(pieces[1:])
                      if children:
                          if broken_ok:
                              child = Tree(
                                  label,
                                  children
                                  + [Tree(normalize(child_label))],
                              )
                          else:
                              raise MixedTreeError(
                                  token_iterator.line_num,
                                  child_label,
                                  children,
                              )
                      else:
                          child = Tree(
                              label, Tree(normalize(child_label))
                          )
                  if not children_stack:
                      return child
              else:
                  if not children_stack:
                      return Tree("ROOT", children)
                  elif broken_ok:
                      child = Tree(None, children)
                  else:
                      raise UnlabeledTreeError(token_iterator.line_num)
              children_stack[-1].append(child)
          else:
              text_stack[-1].append(token)
          token = next(token_iterator, None)
      raise UnclosedTreeError(token_iterator.get_mark())
  
imports: from collections import deque
  import logging
  import os
  import re
  from stanza.models.constituency.parse_tree import Tree
  from stanza.utils.get_tqdm import get_tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: read_single_tree(token_iterator, broken_ok) and returns: child, Tree