code: def backend_masked_images(attack, fix_get_mnist_subset):
      (
          x_train_mnist,
          y_train_mnist,
          x_test_mnist,
          y_test_mnist,
      ) = fix_get_mnist_subset
  
      # generate a random mask:
      mask = np.random.binomial(
          n=1, p=0.5, size=np.prod(x_test_mnist.shape)
      )
      mask = mask.reshape(x_test_mnist.shape).astype(np.float32)
  
      x_test_adv = attack.generate(x_test_mnist, mask=mask)
      mask_diff = (1 - mask) * (x_test_adv - x_test_mnist)
      np.testing.assert_array_almost_equal(
          mask_diff, np.zeros(mask_diff.shape), decimal=3
      )
  
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 10 for calling a global function with example usage: backend_masked_images(attack, fix_get_mnist_subset) without return types