code: def test_gmm2d():
      x1 = np.random.normal(0, 1, size=(100, 2))
      x2 = np.random.normal(10, 1, size=(100, 2))
      X = np.vstack((x1, x2))
      y = np.zeros(200)
      y[100:] = 1
  
      for ncm in (1, 2, 3):
          clf = GMMBayes(ncm)
          clf.fit(X, y)
  
          predicted = clf.predict(X)
          assert_allclose(y, predicted)
  
file_path: astroML/astroML/classification/tests/test_gmm_bayes.py
imports: import numpy
  from numpy.testing import assert_allclose
  import pytest
  from astroML.classification import GMMBayes
label_desc: Use image node_id 2 for calling a global function with example usage: test_gmm2d() without return types