code: def test_unfitted_gmm_score(backend):
      """Test GMM detector raises exceptions when not fitted."""
      gmm_detector = GMM(n_components=2, backend=backend)
      x = np.array([[0, 10], [0.1, 0]])
      x_ref = np.random.randn(100, 2)
  
      with pytest.raises(NotFittedError) as err:
          gmm_detector.infer_threshold(x_ref, 0.1)
      assert str(err.value) == "GMM has not been fit!"
  
      with pytest.raises(NotFittedError) as err:
          gmm_detector.score(x)
      assert str(err.value) == "GMM has not been fit!"
  
      # test predict raises exception when not fitted
      with pytest.raises(NotFittedError) as err:
          gmm_detector.predict(x)
      assert str(err.value) == "GMM has not been fit!"
  
file_path: alibi-detect/alibi_detect/od/tests/test__gmm/test__gmm.py
imports: import pytest
  import numpy
  import torch
  from alibi_detect.od._gmm import GMM
  from alibi_detect.exceptions import NotFittedError
  from sklearn.datasets import make_moons
label_desc: Use image node_id 1 for calling a global function with example usage: test_unfitted_gmm_score(backend) without return types