code: def test_fitted_lof_score():
      """
      Test fitted but not threshold inferred non-ensemble detectors can still score data using the predict method.
      Unlike the ensemble detectors, the non-ensemble detectors do not require the ensembler to be fit in the
      infer_threshold method. See the test_fitted_lof_ensemble_score test for the ensemble case.
      """
      lof_detector = LOF(k=10)
      x_ref = np.random.randn(100, 2)
      lof_detector.fit(x_ref)
      x = np.array([[0, 10], [0.1, 0]])
      y = lof_detector.predict(x)
      y = y["data"]
      assert y["instance_score"][0] > y["instance_score"][1]
      assert not y["threshold_inferred"]
      assert y["threshold"] is None
      assert y["is_outlier"] is None
      assert y["p_value"] is None
  
file_path: alibi-detect/alibi_detect/od/tests/test__lof/test__lof.py
imports: import pytest
  import numpy
  import torch
  from alibi_detect.od._lof import LOF
  from alibi_detect.od.pytorch.ensemble import AverageAggregator, TopKAggregator, MaxAggregator, MinAggregator, ShiftAndScaleNormalizer, PValNormalizer
  from alibi_detect.exceptions import NotFittedError, ThresholdNotInferredError
  from sklearn.datasets import make_moons
label_desc: Use image node_id 3 for calling a global function with example usage: test_fitted_lof_score() without return types