code: def setUpClass(cls):
      (x_train, y_train), (x_test, y_test), min_, max_ = load_mnist()
      x_train, y_train = x_train[:NB_TRAIN], y_train[:NB_TRAIN]
      cls.mnist = (x_train, y_train), (x_test, y_test), (min_, max_)
  
      # Create simple keras model
      import tensorflow as tf
  
      tf_version = [int(v) for v in tf.__version__.split(".")]
      if tf_version[0] == 2 and tf_version[1] >= 3:
          tf.compat.v1.disable_eager_execution()
          from tensorflow.keras.models import Sequential
          from tensorflow.keras.layers import (
              Dense,
              Flatten,
              Conv2D,
              MaxPooling2D,
          )
      else:
          from keras.models import Sequential
          from keras.layers import Dense, Flatten, Conv2D, MaxPooling2D
  
      model = Sequential()
      model.add(
          Conv2D(
              32,
              kernel_size=(3, 3),
              activation="relu",
              input_shape=x_train.shape[1:],
          )
      )
      model.add(MaxPooling2D(pool_size=(3, 3)))
      model.add(Flatten())
      model.add(Dense(10, activation="softmax"))
  
      model.compile(
          loss="categorical_crossentropy",
          optimizer="adam",
          metrics=["accuracy"],
      )
  
      from art.estimators.classification.keras import KerasClassifier
  
      cls.classifier = KerasClassifier(
          model=model, clip_values=(min_, max_)
      )
  
      cls.classifier.fit(x_train, y_train, nb_epochs=1, batch_size=128)
  
      cls.defence = ActivationDefence(cls.classifier, x_train, y_train)
  
      datagen = ImageDataGenerator()
      datagen.fit(x_train)
  
      data_gen = KerasDataGenerator(
          datagen.flow(x_train, y_train, batch_size=NB_TRAIN),
          size=NB_TRAIN,
          batch_size=NB_TRAIN,
      )
  
      cls.defence_gen = ActivationDefence(
          cls.classifier, None, None, generator=data_gen
      )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import unittest
  from keras.preprocessing.image import ImageDataGenerator
  import numpy
  from art.data_generators import KerasDataGenerator
  from art.defences.detector.poison import ActivationDefence
  from art.utils import load_mnist
  from art.visualization import convert_to_rgb
  from tests.utils import master_seed
label_desc: Use image node_id 1 for calling the TestActivationDefence obj's underlying member method code with example usage: obj.setUpClass(cls) without return types