code: def test_check_means():
      rng = np.random.RandomState(0)
      rand_data = RandomData(rng)
  
      n_components, n_features = (
          rand_data.n_components,
          rand_data.n_features,
      )
      X = rand_data.X["full"]
  
      g = GaussianMixture(n_components=n_components)
  
      # Check means bad shape
      means_bad_shape = rng.rand(n_components + 1, n_features)
      g.means_init = means_bad_shape
      msg = "The parameter 'means' should have the shape of "
      with pytest.raises(ValueError, match=msg):
          g.fit(X)
  
      # Check good means matrix
      means = rand_data.means
      g.means_init = means
      g.fit(X)
      assert_array_equal(means, g.means_init)
  
imports: import copy
  import itertools
  import re
  import sys
  import warnings
  from io import StringIO
  from unittest.mock import Mock
  import numpy
  import pytest
  from scipy import linalg, stats
  import sklearn
  from sklearn.cluster import KMeans
  from sklearn.covariance import EmpiricalCovariance
  from sklearn.datasets import make_spd_matrix
  from sklearn.exceptions import ConvergenceWarning, NotFittedError
  from sklearn.metrics.cluster import adjusted_rand_score
  from sklearn.mixture import GaussianMixture
  from sklearn.mixture._gaussian_mixture import _compute_log_det_cholesky, _compute_precision_cholesky, _estimate_gaussian_covariances_diag, _estimate_gaussian_covariances_full, _estimate_gaussian_covariances_spherical, _estimate_gaussian_covariances_tied, _estimate_gaussian_parameters
  from sklearn.utils._testing import assert_allclose, assert_almost_equal, assert_array_almost_equal, assert_array_equal, ignore_warnings
  from sklearn.utils.extmath import fast_logdet
label_desc: Use image node_id 4 for calling a global function with example usage: test_check_means() without return types