code: def read_treebank(filename, tree_callback=None):
      """
      Read a treebank and alter the trees to be a simpler format for learning to parse
      """
      logger.info("Reading trees from %s", filename)
      trees = read_tree_file(filename, tree_callback=tree_callback)
      trees = [t.prune_none().simplify_labels() for t in trees]
  
      illegal_trees = [t for t in trees if len(t.children) > 1]
      if len(illegal_trees) > 0:
          raise ValueError(
              "Found {} tree(s) which had non-unary transitions at the ROOT.  First illegal tree: {:P}".format(
                  len(illegal_trees), illegal_trees[0]
              )
          )
  
      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 7 for calling a global function with example usage: read_treebank(filename, tree_callback) and returns: trees