code: def test_imm_wnc2():
      # Test the basic imm_wnc when null class is shrunk to 0
      n = 50
      dim = 1
      alpha = 0.5
      g0 = 1.0
      x = np.random.rand(n, dim)
      x[: int(0.3 * n)] *= 0.2
      x[: int(0.1 * n)] *= 0.3
  
      # instantiate
      migmm = MixedIMM(alpha, dim)
      migmm.set_priors(x)
      migmm.set_constant_densities(null_dens=g0)
      ncp = np.zeros(n)
  
      # warming
      migmm.sample(x, null_class_proba=ncp, niter=100, init=True)
  
      # sampling
      like, pproba = migmm.sample(x, null_class_proba=ncp, niter=300)
      assert like.min() > 0.1
      assert like.max() < 5.0
      assert_array_equal(pproba, ncp)
  
file_path: nipy/nipy/algorithms/clustering/tests/test_imm.py
imports: import numpy
  from numpy.testing import assert_array_equal
  from ..imm import IMM, MixedIMM, co_labelling
label_desc: Use image node_id 10 for calling a global function with example usage: test_imm_wnc2() without return types