code: def test_skope_rules_works():
      # toy sample (the last two samples are outliers)
      X = [
          [-2, -1],
          [-1, -1],
          [-1, -2],
          [1, 1],
          [1, 2],
          [2, 1],
          [6, 3],
          [4, -7],
      ]
      y = [0] * 6 + [1] * 2
      X_test = [
          [-2, -1],
          [-1, -1],
          [-1, -2],
          [1, 1],
          [1, 2],
          [2, 1],
          [10, 5],
          [5, -7],
      ]
      # Test LOF
      clf = SkopeRules(random_state=rng, max_samples=1.0)
      clf.fit(X, y)
      decision_func = clf.decision_function(X_test)
      rules_vote = clf.rules_vote(X_test)
      score_top_rules = clf.score_top_rules(X_test)
      pred = clf.predict(X_test)
      pred_score_top_rules = clf.predict_top_rules(X_test, 1)
      # assert detect outliers:
      assert_greater(
          np.min(decision_func[-2:]), np.max(decision_func[:-2])
      )
      assert_greater(np.min(rules_vote[-2:]), np.max(rules_vote[:-2]))
      assert_greater(
          np.min(score_top_rules[-2:]), np.max(score_top_rules[:-2])
      )
      assert_array_equal(pred, 6 * [0] + 2 * [1])
      assert_array_equal(pred_score_top_rules, 6 * [0] + 2 * [1])
  
imports: import numpy
  from sklearn.model_selection import ParameterGrid
  from sklearn.datasets import load_iris, load_boston, make_blobs
  from sklearn.metrics import accuracy_score
  from sklearn.utils import check_random_state
  from sklearn.utils.testing import assert_array_equal
  from sklearn.utils.testing import assert_raises
  from sklearn.utils.testing import assert_warns_message
  from sklearn.utils.testing import assert_equal
  from sklearn.utils.testing import assert_in
  from sklearn.utils.testing import assert_not_in
  from sklearn.utils.testing import assert_not_equal
  from sklearn.utils.testing import assert_no_warnings
  from sklearn.utils.testing import assert_greater
  from sklearn.utils.testing import ignore_warnings
  from skrules import SkopeRules
label_desc: Use image node_id 4 for calling a global function with example usage: test_skope_rules_works() without return types