code: def demo(
      print_times=True,
      print_grammar=True,
      print_trees=True,
      print_sentence=True,
      trace=1,
      parser=FeatureChartParser,
      sent="I saw John with a dog with my cookie",
  ):
      import sys
      import time
  
      print()
      grammar = demo_grammar()
      if print_grammar:
          print(grammar)
          print()
      print("*", parser.__name__)
      if print_sentence:
          print("Sentence:", sent)
      tokens = sent.split()
      t = perf_counter()
      cp = parser(grammar, trace=trace)
      chart = cp.chart_parse(tokens)
      trees = list(chart.parses(grammar.start()))
      if print_times:
          print("Time: %s" % (perf_counter() - t))
      if print_trees:
          for tree in trees:
              print(tree)
      else:
          print("Nr trees:", len(trees))
  
imports: from time import perf_counter
  from nltk.featstruct import TYPE, FeatStruct, find_variables, unify
  from nltk.grammar import CFG, FeatStructNonterminal, Nonterminal, Production, is_nonterminal, is_terminal
  from nltk.parse.chart import BottomUpPredictCombineRule, BottomUpPredictRule, CachedTopDownPredictRule, Chart, ChartParser, EdgeI, EmptyPredictRule, FundamentalRule, LeafInitRule, SingleEdgeFundamentalRule, TopDownInitRule, TreeEdge
  from nltk.sem import logic
  from nltk.tree import Tree
label_desc: Use image node_id 2 for calling a global function with example usage: demo(print_times, print_grammar, print_trees, print_sentence, trace, parser, sent) without return types