code: def test_skope_rules_error():
      """Test that it gives proper exception on deficient input."""
      X = iris.data
      y = iris.target
      y = y != 0
  
      # Test max_samples
      assert_raises(ValueError, SkopeRules(max_samples=-1).fit, X, y)
      assert_raises(ValueError, SkopeRules(max_samples=0.0).fit, X, y)
      assert_raises(ValueError, SkopeRules(max_samples=2.0).fit, X, y)
      # explicitly setting max_samples > n_samples should result in a warning.
      assert_warns_message(
          UserWarning,
          "max_samples will be set to n_samples for estimation",
          SkopeRules(max_samples=1000).fit,
          X,
          y,
      )
      assert_no_warnings(SkopeRules(max_samples=np.int64(2)).fit, X, y)
      assert_raises(
          ValueError, SkopeRules(max_samples="foobar").fit, X, y
      )
      assert_raises(ValueError, SkopeRules(max_samples=1.5).fit, X, y)
      assert_raises(
          ValueError, SkopeRules(max_depth_duplication=1.5).fit, X, y
      )
      assert_raises(
          ValueError, SkopeRules().fit(X, y).predict, X[:, 1:]
      )
      assert_raises(
          ValueError, SkopeRules().fit(X, y).decision_function, X[:, 1:]
      )
      assert_raises(
          ValueError, SkopeRules().fit(X, y).rules_vote, X[:, 1:]
      )
      assert_raises(
          ValueError, SkopeRules().fit(X, y).score_top_rules, X[:, 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 2 for calling a global function with example usage: test_skope_rules_error() without return types