code: def read_token_iterator(token_iterator, broken_ok, tree_callback):
      trees = []
      token = next(token_iterator, None)
      while token:
          if token == OPEN_PAREN:
              next_tree = read_single_tree(
                  token_iterator, broken_ok=broken_ok
              )
              if next_tree is None:
                  raise ValueError(
                      "Tree reader somehow created a None tree!  Line number %d"
                      % token_iterator.line_num
                  )
              if tree_callback is not None:
                  tree_callback(next_tree)
              else:
                  trees.append(next_tree)
              token = next(token_iterator, None)
          elif token == CLOSE_PAREN:
              raise ExtraCloseTreeError(token_iterator.line_num)
          else:
              raise ValueError(
                  "Tree document had text between trees!  Line number %d"
                  % token_iterator.line_num
              )
  
      if tree_callback is None:
          return trees
  
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 3 for calling a global function with example usage: read_token_iterator(token_iterator, broken_ok, tree_callback) and returns: trees