code: def test_errors(
      art_warning, tabular_dl_estimator_for_attack, get_iris_dataset
  ):
      try:
          classifier = tabular_dl_estimator_for_attack(
              AttributeInferenceMembership
          )
          (x_train, y_train), (x_test, y_test) = get_iris_dataset
          meminf_attack = MembershipInferenceBlackBox(
              classifier, attack_model_type="nn"
          )
  
          with pytest.raises(ValueError):
              AttributeInferenceMembership(
                  classifier, meminf_attack, attack_feature="a"
              )
          with pytest.raises(ValueError):
              AttributeInferenceMembership(
                  classifier, meminf_attack, attack_feature=-3
              )
  
          attack = AttributeInferenceMembership(
              classifier, meminf_attack
          )
          with pytest.raises(ValueError):
              AttributeInferenceMembership(
                  classifier, attack, attack_feature=1
              )
          with pytest.raises(ValueError):
              attack.infer(x_train, y_test, values=[1, 2])
          with pytest.raises(ValueError):
              attack.infer(x_train, y_train)
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/attacks/inference/attribute_inference/test_meminf_based.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import pytest
  import numpy
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.preprocessing import StandardScaler
  from art.attacks.inference.attribute_inference.meminf_based import AttributeInferenceMembership
  from art.attacks.inference.membership_inference import MembershipInferenceBlackBox, MembershipInferenceBlackBoxRuleBased, LabelOnlyDecisionBoundary
  from art.estimators.classification.scikitlearn import ScikitlearnDecisionTreeClassifier
  from art.estimators.regression import ScikitlearnRegressor
  from tests.utils import ARTTestException
label_desc: Use image node_id 8 for calling a global function with example usage: test_errors(art_warning, tabular_dl_estimator_for_attack, get_iris_dataset) without return types