code: def test_perplexity(self):
      prob_0_a = 0.9 * 0.5 + 0.1 * 0.5
      prob_0_b = 0.9 * 0.1 + 0.1 * 0.9
      prob_1_b = 0.7 * 0.1 + 0.3 * 0.9
      prob_1_c = 0.7 * 0.25 + 0.3 * 0.75
      prob_2_a = 0.1 * 0.5 + 0.9 * 0.5
      prob_2_d = 0
  
      perp = 0.0
      perp += 3 * np.log(prob_0_a) + 5 * np.log(prob_0_b)
      perp += 5 * np.log(prob_1_b) + 7 * np.log(prob_1_c)
      perp += 2 * np.log(prob_2_a)
      perp = np.exp(-perp / (3 + 5 + 5 + 7 + 2))
  
      observed_perp = perplexity(
          self.docs, self.doc_topics, self.word_topics, self.vocabulary
      )
  
      self.assertAlmostEqual(perp, observed_perp, delta=0.0001)
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import os
  import tempfile
  import shutil
  import unittest
  import turicreate
  from turicreate.toolkits._main import ToolkitError
  from turicreate.toolkits.topic_model import topic_model
  from turicreate.toolkits.text_analytics import parse_sparse
  from turicreate.toolkits.text_analytics import parse_docword
  from turicreate.toolkits.topic_model import perplexity
  from .None import util
  import time
  import random
  import numpy
  import itertools
label_desc: Use image node_id 2 for calling the UtilitiesTest obj's underlying member method code with example usage: obj.test_perplexity() without return types