code: def test_poison_estimator_red(
      art_warning, image_dl_generator, x_target
  ):
      try:
          generator = image_dl_generator()
          generator.model.layers[-1].activation = linear
  
          red_attack = BackdoorAttackDGMReDTensorFlowV2(
              generator=generator
          )
          z_trigger = np.random.randn(1, 100)
  
          generator = red_attack.poison_estimator(
              z_trigger=z_trigger, x_target=x_target, max_iter=2
          )
          assert isinstance(generator, TensorFlowV2Generator)
          np.testing.assert_approx_equal(
              round(
                  red_attack.fidelity(z_trigger, x_target).numpy(), 4
              ),
              0.33,
              significant=1,
          )
  
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/attacks/poison/test_backdoor_attack_dgm_red.py
imports: import numpy
  import pytest
  from tensorflow.keras.activations import linear
  from tests.utils import ARTTestException, master_seed
  from art.attacks.poisoning.backdoor_attack_dgm.backdoor_attack_dgm_red import BackdoorAttackDGMReDTensorFlowV2
  from art.estimators.generation.tensorflow import TensorFlowV2Generator
label_desc: Use image node_id 2 for calling a global function with example usage: test_poison_estimator_red(art_warning, image_dl_generator, x_target) without return types