code: def test_bayesian_mixture_check_is_fitted():
      rng = np.random.RandomState(0)
      n_samples, n_features = 10, 2
  
      # Check raise message
      bgmm = BayesianGaussianMixture(random_state=rng)
      X = rng.rand(n_samples, n_features)
  
      msg = "This BayesianGaussianMixture instance is not fitted yet."
      with pytest.raises(ValueError, match=msg):
          bgmm.score(X)
  
imports: import copy
  import numpy
  import pytest
  from scipy.special import gammaln
  from sklearn.exceptions import ConvergenceWarning, NotFittedError
  from sklearn.metrics.cluster import adjusted_rand_score
  from sklearn.mixture import BayesianGaussianMixture
  from sklearn.mixture._bayesian_mixture import _log_dirichlet_norm, _log_wishart_norm
  from sklearn.mixture.tests.test_gaussian_mixture import RandomData
  from sklearn.utils._testing import assert_almost_equal, assert_array_equal, ignore_warnings
label_desc: Use image node_id 6 for calling a global function with example usage: test_bayesian_mixture_check_is_fitted() without return types