code: def test_alpha(self):
      kwargs = dict(id2word=dictionary, num_topics=2, alpha=None)
      expected_shape = (2,)
  
      # should not raise anything
      self.class_(**kwargs)
  
      kwargs["alpha"] = "symmetric"
      model = self.class_(**kwargs)
      self.assertEqual(model.alpha.shape, expected_shape)
      assert_allclose(model.alpha, np.array([0.5, 0.5]))
  
      kwargs["alpha"] = "asymmetric"
      model = self.class_(**kwargs)
      self.assertEqual(model.alpha.shape, expected_shape)
      assert_allclose(model.alpha, [0.630602, 0.369398], rtol=1e-5)
  
      kwargs["alpha"] = 0.3
      model = self.class_(**kwargs)
      self.assertEqual(model.alpha.shape, expected_shape)
      assert_allclose(model.alpha, np.array([0.3, 0.3]))
  
      kwargs["alpha"] = 3
      model = self.class_(**kwargs)
      self.assertEqual(model.alpha.shape, expected_shape)
      assert_allclose(model.alpha, np.array([3, 3]))
  
      kwargs["alpha"] = [0.3, 0.3]
      model = self.class_(**kwargs)
      self.assertEqual(model.alpha.shape, expected_shape)
      assert_allclose(model.alpha, np.array([0.3, 0.3]))
  
      kwargs["alpha"] = np.array([0.3, 0.3])
      model = self.class_(**kwargs)
      self.assertEqual(model.alpha.shape, expected_shape)
      assert_allclose(model.alpha, np.array([0.3, 0.3]))
  
      # all should raise an exception for being wrong shape
      kwargs["alpha"] = [0.3, 0.3, 0.3]
      self.assertRaises(AssertionError, self.class_, **kwargs)
  
      kwargs["alpha"] = [[0.3], [0.3]]
      self.assertRaises(AssertionError, self.class_, **kwargs)
  
      kwargs["alpha"] = [0.3]
      self.assertRaises(AssertionError, self.class_, **kwargs)
  
      kwargs["alpha"] = "gensim is cool"
      self.assertRaises(ValueError, self.class_, **kwargs)
  
imports: import logging
  import numbers
  import os
  import unittest
  import copy
  import numpy
  from numpy.testing import assert_allclose
  from gensim.corpora import mmcorpus, Dictionary
  from gensim.models import ldamodel, ldamulticore
  from gensim import matutils, utils
  from gensim.test import basetmtests
  from gensim.test.utils import datapath, get_tmpfile, common_texts
label_desc: Use image node_id 5 for calling the TestLdaModel obj's underlying member method code with example usage: obj.test_alpha() without return types