code: def test_add_single_bd(art_warning):
      try:
          image = add_single_bd(
              x=np.ones((4, 4, 4, 3)), distance=2, pixel_value=0
          )
          assert image.shape == (4, 4, 4, 3)
          assert np.min(image) == 0
  
          image = add_single_bd(
              x=np.ones((3, 3, 3)), distance=2, pixel_value=0
          )
          assert image.shape == (3, 3, 3)
          assert np.min(image) == 0
  
          image = add_single_bd(
              x=np.ones((2, 2)), distance=2, pixel_value=0
          )
          assert image.shape == (2, 2)
          assert np.min(image) == 0
  
          with pytest.raises(ValueError):
              _ = add_single_bd(
                  x=np.ones((5, 5, 5, 5, 5)), distance=2, pixel_value=0
              )
  
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/attacks/poison/test_image_perturbations.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import os
  import numpy
  import pytest
  from art.attacks.poisoning.perturbations import add_single_bd, add_pattern_bd, insert_image
  from tests.utils import ARTTestException
label_desc: Use image node_id 1 for calling a global function with example usage: test_add_single_bd(art_warning) without return types