code: def test_dirichlet_expectation(self):
      # test dirichlet_expectation
      rs = self.random_state
  
      for dtype in [np.float16, np.float32, np.float64]:
          for i in range(self.num_runs):
              # 1 dimensional case
              input_1d = rs.uniform(
                  0.01, 10000, size=(self.num_topics,)
              )
              known_good = dirichlet_expectation(input_1d)
              test_values = matutils.dirichlet_expectation(input_1d)
  
              msg = (
                  "dirichlet_expectation_1d failed for dtype={}".format(
                      dtype
                  )
              )
              self.assertTrue(np.allclose(known_good, test_values), msg)
  
              # 2 dimensional case
              input_2d = rs.uniform(
                  0.01,
                  10000,
                  size=(
                      1,
                      self.num_topics,
                  ),
              )
              known_good = dirichlet_expectation(input_2d)
              test_values = matutils.dirichlet_expectation(input_2d)
  
              msg = (
                  "dirichlet_expectation_2d failed for dtype={}".format(
                      dtype
                  )
              )
              self.assertTrue(np.allclose(known_good, test_values), msg)
  
imports: import logging
  import unittest
  import numpy
  from numpy.testing import assert_array_equal
  from scipy import sparse
  from scipy.sparse import csc_matrix
  from scipy.special import psi
  import gensim.matutils
label_desc: Use image node_id 4 for calling the TestLdaModelInner obj's underlying member method code with example usage: obj.test_dirichlet_expectation() without return types