code: def test_dirichlet_eval():
      # check that the Dirichlet evaluation function sums to one on a simple
      # example
      alpha = np.array([0.5, 0.5])
      sd = 0
      for i in range(10000):
          e = i * 0.0001 + 0.00005
          sd += dirichlet_eval(np.array([e, 1 - e]), alpha)
      assert np.absolute(sd.sum() * 0.0001 - 1) < 0.01
  
file_path: nipy/nipy/algorithms/clustering/tests/test_bgmm.py
imports: import numpy
  import numpy.random
  from ..bgmm import BGMM, VBGMM, dirichlet_eval, dkl_gaussian, multinomial
label_desc: Use image node_id 1 for calling a global function with example usage: test_dirichlet_eval() without return types