code: def test_generate(
      art_warning,
      get_default_mnist_subset,
      image_dl_estimator_for_attack,
      targeted,
      norm,
  ):
      try:
          (_, _), (
              x_test_mnist,
              y_test_mnist,
          ) = get_default_mnist_subset
          classifier = image_dl_estimator_for_attack(
              BrendelBethgeAttack, defended=False, from_logits=True
          )
  
          attack = BrendelBethgeAttack(
              estimator=classifier,
              norm=norm,
              targeted=targeted,
              overshoot=1.1,
              steps=1,
              lr=1e-3,
              lr_decay=0.5,
              lr_num_decay=20,
              momentum=0.8,
              binary_search_steps=1,
              init_size=5,
              batch_size=32,
          )
  
          attack.generate(
              x=x_test_mnist[0:1].astype(np.float32),
              y=y_test_mnist[0:1].astype(int),
          )
  
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/attacks/evasion/test_brendel_and_bethge.py
imports: import logging
  import numpy
  import pytest
  from art.attacks.evasion import BrendelBethgeAttack
  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 1 for calling a global function with example usage: test_generate(art_warning, get_default_mnist_subset, image_dl_estimator_for_attack, targeted, norm) without return types