code: def test_subsetscannning_detector_scan_size(
      art_warning, get_default_mnist_subset, image_dl_estimator
  ):
      (x_train, _), (x_test, _) = get_default_mnist_subset
      classifier, _ = image_dl_estimator()
  
      # Generate adversarial samples
      attacker = FastGradientMethod(classifier, eps=0.5)
      x_test_adv = attacker.generate(x_test)
  
      # Compile training data for detector:
      bgd_data = x_train
      clean_data = x_test
      adv_data = np.concatenate((x_test, x_test_adv), axis=0)
  
      try:
          detector = SubsetScanningDetector(
              classifier, bgd_data=bgd_data, layer=1
          )
          _, _, dpwr = detector.scan(
              clean_x=clean_data,
              adv_x=adv_data,
              clean_size=85,
              adv_size=15,
          )
          assert dpwr > 0
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/defences/detector/evasion/test_subsetscanning_detector.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import pytest
  import numpy
  from art.attacks.evasion.fast_gradient import FastGradientMethod
  from art.defences.detector.evasion import SubsetScanningDetector
  from tests.utils import ARTTestException
label_desc: Use image node_id 3 for calling a global function with example usage: test_subsetscannning_detector_scan_size(art_warning, get_default_mnist_subset, image_dl_estimator) without return types