code: def backend_test_defended_images(attack, mnist_dataset):
      (
          x_train_mnist,
          y_train_mnist,
          x_test_mnist,
          y_test_mnist,
      ) = mnist_dataset
      x_train_adv = attack.generate(x_train_mnist)
  
      check_adverse_example_x(x_train_adv, x_train_mnist)
  
      y_train_pred_adv = get_labels_np_array(
          attack.estimator.predict(x_train_adv)
      )
      y_train_labels = get_labels_np_array(y_train_mnist)
  
      check_adverse_predicted_sample_y(y_train_pred_adv, y_train_labels)
  
      x_test_adv = attack.generate(x_test_mnist)
      check_adverse_example_x(x_test_adv, x_test_mnist)
  
      y_test_pred_adv = get_labels_np_array(
          attack.estimator.predict(x_test_adv)
      )
      check_adverse_predicted_sample_y(y_test_pred_adv, y_test_mnist)
  
file_path: adversarial-robustness-toolbox/tests/attacks/utils.py
imports: import pytest
  import numpy
  import logging
  import keras.backend
  from art.utils import random_targets, get_labels_np_array
  from art.exceptions import EstimatorError
  from tests.utils import check_adverse_example_x, check_adverse_predicted_sample_y
label_desc: Use image node_id 2 for calling a global function with example usage: backend_test_defended_images(attack, mnist_dataset) without return types