code: def demo():
      # demonstrates HMM probability calculation
  
      print()
      print("HMM probability calculation demo")
      print()
  
      model, states, symbols = _market_hmm_example()
  
      print("Testing", model)
  
      for test in [
          ["up", "up"],
          ["up", "down", "up"],
          ["down"] * 5,
          ["unchanged"] * 5 + ["up"],
      ]:
          sequence = [(t, None) for t in test]
  
          print("Testing with state sequence", test)
          print("probability =", model.probability(sequence))
          print(
              "tagging =    ",
              model.tag([word for (word, tag) in sequence]),
          )
          print("p(tagged) =  ", model.probability(sequence))
          print("H =          ", model.entropy(sequence))
          print("H_exh =      ", model._exhaustive_entropy(sequence))
          print("H(point) =   ", model.point_entropy(sequence))
          print(
              "H_exh(point)=", model._exhaustive_point_entropy(sequence)
          )
          print()
  
imports: import itertools
  import re
  from nltk.metrics import accuracy
  from nltk.probability import ConditionalFreqDist, ConditionalProbDist, DictionaryConditionalProbDist, DictionaryProbDist, FreqDist, LidstoneProbDist, MLEProbDist, MutableProbDist, RandomProbDist
  from nltk.tag.api import TaggerI
  from nltk.util import LazyMap, unique_list
label_desc: Use image node_id 7 for calling a global function with example usage: demo() without return types