code: def test_fitted_gmm_predict(backend):
      """Test GMM detector predict method.
  
      Test GMM detector that has been fitted on reference data and has had a threshold
      inferred can score data using the predict method as well as predict outliers. Test that it
      returns `threshold`, `p_value` and `is_outlier` values.
      """
      gmm_detector = GMM(n_components=1, backend=backend)
      x_ref = np.random.randn(100, 2)
      gmm_detector.fit(x_ref)
      gmm_detector.infer_threshold(x_ref, 0.1)
      x = np.array([[0, 10], [0, 0.1]])
      y = gmm_detector.predict(x)
      y = y["data"]
      assert y["instance_score"][0] > 5
      assert y["instance_score"][1] < 2
      assert y["threshold_inferred"]
      assert y["threshold"] is not None
      assert isinstance(y["threshold"], float)
      assert y["p_value"].all()
      assert (y["is_outlier"] == [True, False]).all()
  
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 3 for calling a global function with example usage: test_fitted_gmm_predict(backend) without return types