code: def test():
      """Do some tree drawing tests."""
  
      def print_tree(n, tree, sentence=None, ansi=True, **xargs):
          print()
          print(
              '{}: "{}"'.format(n, " ".join(sentence or tree.leaves()))
          )
          print(tree)
          print()
          drawtree = TreePrettyPrinter(tree, sentence)
          try:
              print(
                  drawtree.text(unicodelines=ansi, ansi=ansi, **xargs)
              )
          except (UnicodeDecodeError, UnicodeEncodeError):
              print(
                  drawtree.text(unicodelines=False, ansi=False, **xargs)
              )
  
      from nltk.corpus import treebank
  
      for n in [0, 1440, 1591, 2771, 2170]:
          tree = treebank.parsed_sents()[n]
          print_tree(n, tree, nodedist=2, maxwidth=8)
      print()
      print("ASCII version:")
      print(TreePrettyPrinter(tree).text(nodedist=2))
  
      tree = Tree.fromstring(
          "(top (punct 8) (smain (noun 0) (verb 1) (inf (verb 5) (inf (verb 6) "
          "(conj (inf (pp (prep 2) (np (det 3) (noun 4))) (verb 7)) (inf (verb 9)) "
          "(vg 10) (inf (verb 11)))))) (punct 12))",
          read_leaf=int,
      )
      sentence = (
          "Ze had met haar moeder kunnen gaan winkelen ,"
          " zwemmen of terrassen .".split()
      )
      print_tree("Discontinuous tree", tree, sentence, nodedist=2)
  
file_path: nltk/nltk/tree/prettyprinter.py
imports: import re
  from collections import defaultdict
  from operator import itemgetter
  from nltk.tree.tree import Tree
  from nltk.util import OrderedDict
label_desc: Use image node_id 1 for calling a global function with example usage: test() without return types