code: def test_check_params(
      art_warning, get_default_mnist_subset, image_dl_estimator
  ):
      try:
          classifier, _ = image_dl_estimator(functional=True)
          # Test bad patch
          with pytest.raises(ValueError):
              _ = SleeperAgentAttack(
                  classifier,
                  percent_poison=0.01,
                  learning_rate_schedule=[0.1, 0.2, 0.3],
                  indices_target=[0],
                  patch=[1],
              )
  
          # Test bad indices
          with pytest.raises(ValueError):
              _ = SleeperAgentAttack(
                  classifier,
                  percent_poison=0.01,
                  learning_rate_schedule=[0.1, 0.2, 0.3],
                  indices_target=0,
                  patch=np.ones((1, 8, 8)),
              )
  
          # Test bad patching strategy
          with pytest.raises(ValueError):
              _ = SleeperAgentAttack(
                  classifier,
                  percent_poison=0.01,
                  learning_rate_schedule=[0.1, 0.2, 0.3],
                  indices_target=[0],
                  patch=np.ones((1, 8, 8)),
                  patching_strategy=1,
              )
  
          # Test bad selection strategy
          with pytest.raises(ValueError):
              _ = SleeperAgentAttack(
                  classifier,
                  percent_poison=0.01,
                  learning_rate_schedule=[0.1, 0.2, 0.3],
                  indices_target=[0],
                  patch=np.ones((1, 8, 8)),
                  selection_strategy=1,
              )
          # Test same source and class
          with pytest.raises(ValueError):
              _ = SleeperAgentAttack(
                  classifier,
                  percent_poison=0.01,
                  learning_rate_schedule=[0.1, 0.2, 0.3],
                  indices_target=[0],
                  patch=np.ones((1, 8, 8)),
                  selection_strategy=1,
                  class_source=0,
                  class_target=0,
              )
  
          # Test invalid poison percent
          with pytest.raises(ValueError):
              _ = SleeperAgentAttack(
                  classifier,
                  percent_poison=1.1,
                  learning_rate_schedule=[0.1, 0.2, 0.3],
                  indices_target=[0],
                  patch=np.ones((1, 8, 8)),
                  selection_strategy=1,
              )
  
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/attacks/poison/test_sleeper_agent_attack.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import numpy
  import pytest
  from PIL import Image
  from art.attacks.poisoning.sleeper_agent_attack import SleeperAgentAttack
  from tests.utils import ARTTestException
label_desc: Use image node_id 2 for calling a global function with example usage: test_check_params(art_warning, get_default_mnist_subset, image_dl_estimator) without return types