code: def test_generate(
      art_warning, fix_get_mnist_subset, image_dl_estimator_for_attack
  ):
      try:
          classifier = image_dl_estimator_for_attack(ShadowAttack)
          attack = ShadowAttack(
              estimator=classifier,
              sigma=0.5,
              nb_steps=3,
              learning_rate=0.1,
              lambda_tv=0.3,
              lambda_c=1.0,
              lambda_s=0.5,
              batch_size=32,
              targeted=True,
              verbose=False,
          )
  
          (
              x_train_mnist,
              y_train_mnist,
              x_test_mnist,
              y_test_mnist,
          ) = fix_get_mnist_subset
  
          x_train_mnist_adv = attack.generate(
              x=x_train_mnist[0:1], y=y_train_mnist[0:1]
          )
  
          assert np.max(
              np.abs(x_train_mnist_adv - x_train_mnist[0:1])
          ) == pytest.approx(0.3803413510322571, abs=0.06)
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/attacks/evasion/test_shadow_attack.py
imports: import logging
  import pytest
  import numpy
  from art.attacks.evasion import ShadowAttack
  from art.estimators.estimator import BaseEstimator, LossGradientsMixin
  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 2 for calling a global function with example usage: test_generate(art_warning, fix_get_mnist_subset, image_dl_estimator_for_attack) without return types