code: def test_attack_if_targeted_not_supported(
      art_warning, fix_get_mnist_subset, image_dl_estimator
  ):
      with pytest.raises(ValueError) as excinfo:
          classifier, _ = image_dl_estimator(from_logits=True)
          attack = SquareAttack(
              estimator=classifier,
              norm=np.inf,
              max_iter=5000,
              eps=0.3,
              p_init=0.8,
              nb_restarts=5,
          )
          attack.set_params(targeted=True)
      assert (
          str(excinfo.value)
          == """The attribute "targeted" cannot be set for this attack."""
      )
  
file_path: adversarial-robustness-toolbox/tests/attacks/evasion/test_auto_attack.py
imports: import logging
  import pytest
  import numpy
  from art.attacks.evasion import AutoAttack
  from art.attacks.evasion.auto_projected_gradient_descent import AutoProjectedGradientDescent
  from art.attacks.evasion.deepfool import DeepFool
  from art.attacks.evasion.square_attack import SquareAttack
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassifierMixin
  from tests.attacks.utils import backend_test_classifier_type_check_fail
  from tests.utils import ARTTestException
label_desc: Use image node_id 4 for calling a global function with example usage: test_attack_if_targeted_not_supported(art_warning, fix_get_mnist_subset, image_dl_estimator) without return types