code: def test_novelty_errors():
      X = iris.data
  
      # check errors for novelty=False
      clf = neighbors.LocalOutlierFactor()
      clf.fit(X)
      # predict, decision_function and score_samples raise ValueError
      for method in ["predict", "decision_function", "score_samples"]:
          msg = "{} is not available when novelty=False".format(method)
          with pytest.raises(AttributeError, match=msg):
              getattr(clf, method)
  
      # check errors for novelty=True
      clf = neighbors.LocalOutlierFactor(novelty=True)
      msg = "fit_predict is not available when novelty=True"
      with pytest.raises(AttributeError, match=msg):
          getattr(clf, "fit_predict")
  
imports: import re
  from math import sqrt
  import numpy
  import pytest
  from sklearn import metrics, neighbors
  from sklearn.datasets import load_iris
  from sklearn.metrics import roc_auc_score
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_allclose, assert_array_equal
  from sklearn.utils.estimator_checks import check_outlier_corruption, parametrize_with_checks
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 7 for calling a global function with example usage: test_novelty_errors() without return types