code: def backend_check_adverse_frames(
      attack, mnist_dataset, expected_values
  ):
      (
          x_train_mnist,
          y_train_mnist,
          x_test_mnist,
          y_test_mnist,
      ) = mnist_dataset
      x_test_adv = attack.generate(x_test_mnist)
  
      x_diff = x_test_adv - x_test_mnist
      x_diff = np.swapaxes(x_diff, 1, attack.frame_index)
      x_diff = np.reshape(
          x_diff, x_diff.shape[:2] + (np.prod(x_diff.shape[2:]),)
      )
      x_diff_norm = np.round(
          np.linalg.norm(x_diff, axis=-1), decimals=4
      )
      x_diff_norm = np.linalg.norm(x_diff_norm, ord=0, axis=-1)
  
      np.testing.assert_array_equal(
          x_diff_norm, expected_values["nb_perturbed_frames"].value
      )
  
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 5 for calling a global function with example usage: backend_check_adverse_frames(attack, mnist_dataset, expected_values) without return types