code: def test_too_many_components_warning():
      X = np.random.normal(0, 1, size=(3, 2))
      y = np.zeros(3)
  
      ncm = 5
      clf = GMMBayes(ncm)
  
      with pytest.warns(
          UserWarning,
          match="Expected n_samples >= " "n_components but got ",
      ):
          clf.fit(X, y)
  
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 5 for calling a global function with example usage: test_too_many_components_warning() without return types