code: def test_gmm_sklearn_scoring():
      """Test GMM detector sklearn scoring method.
  
      Tests the scoring method of the GMM sklearn backend detector.
      """
      gmm_sklearn = GMMSklearn(n_components=2)
      mean = [8, 8]
      cov = [[2.0, 0.0], [0.0, 1.0]]
      x_ref = np.random.multivariate_normal(mean, cov, 1000)
      gmm_sklearn.fit(x_ref)
  
      x_1 = np.array([[8.0, 8.0]])
      scores_1 = gmm_sklearn.score(x_1)
  
      x_2 = np.random.multivariate_normal(mean, cov, 1)
      scores_2 = gmm_sklearn.score(x_2)
  
      x_3 = np.array([[-10.0, 10.0]])
      scores_3 = gmm_sklearn.score(x_3)
  
      # test correct ordering of scores given outlyingness of data
      assert scores_1 < scores_2 < scores_3
  
      # test that detector correctly detects true outlier
      gmm_sklearn.infer_threshold(x_ref, 0.01)
      x = np.concatenate((x_1, x_2, x_3))
      outputs = gmm_sklearn.predict(x)
      assert np.all(
          outputs.is_outlier == np.array([False, False, True])
      )
      assert np.all(gmm_sklearn(x) == np.array([False, False, True]))
  
      # test that 0.01 of the in distribution data is flagged as outliers
      x = np.random.multivariate_normal(mean, cov, 1000)
      outputs = gmm_sklearn.predict(x)
      assert (outputs.is_outlier.sum() / 1000) - 0.01 < 0.01
  
imports: import pytest
  import numpy
  from alibi_detect.od.sklearn.gmm import GMMSklearn
  from alibi_detect.exceptions import NotFittedError, ThresholdNotInferredError
label_desc: Use image node_id 1 for calling a global function with example usage: test_gmm_sklearn_scoring() without return types