code: def demo():
      """
      A demonstration showing how each tree transform can be used.
      """
  
      from copy import deepcopy
  
      from nltk.draw.tree import draw_trees
      from nltk.tree.tree import Tree
  
      # original tree from WSJ bracketed text
      sentence = """(TOP
    (S
      (S
        (VP
          (VBN Turned)
          (ADVP (RB loose))
          (PP
            (IN in)
            (NP
              (NP (NNP Shane) (NNP Longman) (POS 's))
              (NN trading)
              (NN room)))))
      (, ,)
      (NP (DT the) (NN yuppie) (NNS dealers))
      (VP (AUX do) (NP (NP (RB little)) (ADJP (RB right))))
      (. .)))"""
      t = Tree.fromstring(sentence, remove_empty_top_bracketing=True)
  
      # collapse subtrees with only one child
      collapsedTree = deepcopy(t)
      collapse_unary(collapsedTree)
  
      # convert the tree to CNF
      cnfTree = deepcopy(collapsedTree)
      chomsky_normal_form(cnfTree)
  
      # convert the tree to CNF with parent annotation (one level) and horizontal smoothing of order two
      parentTree = deepcopy(collapsedTree)
      chomsky_normal_form(parentTree, horzMarkov=2, vertMarkov=1)
  
      # convert the tree back to its original form (used to make CYK results comparable)
      original = deepcopy(parentTree)
      un_chomsky_normal_form(original)
  
      # convert tree back to bracketed text
      sentence2 = original.pprint()
      print(sentence)
      print(sentence2)
      print("Sentences the same? ", sentence == sentence2)
  
      draw_trees(t, collapsedTree, cnfTree, parentTree, original)
  
imports: from nltk.tree.tree import Tree
label_desc: Use image node_id 4 for calling a global function with example usage: demo() without return types