code: def get_mnist_classifier(framework):
      def _get_classifier():
          if framework == "pytorch":
              import torch
  
              model = torch.nn.Sequential(
                  torch.nn.Conv2d(
                      in_channels=1, out_channels=1, kernel_size=7
                  ),
                  torch.nn.ReLU(),
                  torch.nn.MaxPool2d(4, 4),
                  torch.nn.Flatten(),
                  torch.nn.Linear(25, 10),
              )
              criterion = torch.nn.CrossEntropyLoss()
              optimizer = torch.optim.Adam(model.parameters(), lr=0.01)
              classifier = PyTorchClassifier(
                  model,
                  loss=criterion,
                  optimizer=optimizer,
                  input_shape=(1, 28, 28),
                  nb_classes=10,
              )
  
          elif framework == "tensorflow2":
              import tensorflow as tf
              from tensorflow.keras import layers, Sequential
  
              model = Sequential()
              model.add(
                  layers.Conv2D(
                      1,
                      kernel_size=(7, 7),
                      activation="relu",
                      input_shape=(28, 28, 1),
                  )
              )
              model.add(layers.MaxPooling2D(pool_size=(4, 4)))
              model.add(layers.Flatten())
              model.add(layers.Dense(10))
  
              loss_object = tf.keras.losses.CategoricalCrossentropy(
                  from_logits=True
              )
              optimizer = tf.keras.optimizers.Adam(learning_rate=0.01)
  
              classifier = TensorFlowV2Classifier(
                  model,
                  nb_classes=10,
                  input_shape=(28, 28, 1),
                  loss_object=loss_object,
                  optimizer=optimizer,
              )
  
          elif framework in ("keras", "kerastf"):
              import tensorflow as tf
              from tensorflow.keras import layers, Sequential
  
              if tf.__version__[0] == "2":
                  tf.compat.v1.disable_eager_execution()
  
              model = Sequential()
              model.add(
                  layers.Conv2D(
                      1,
                      kernel_size=(7, 7),
                      activation="relu",
                      input_shape=(28, 28, 1),
                  )
              )
              model.add(layers.MaxPooling2D(pool_size=(4, 4)))
              model.add(layers.Flatten())
              model.add(layers.Dense(10))
              model.compile(
                  optimizer="adam", loss="categorical_crossentropy"
              )
              classifier = KerasClassifier(
                  model, clip_values=(0, 1), use_logits=True
              )
  
          elif framework == "huggingface":
              classifier = get_image_classifier_hf(from_logits=True)
  
          else:
              classifier = None
  
          return classifier
  
      return _get_classifier
  
file_path: adversarial-robustness-toolbox/tests/defences/trainer/test_dp_instahide_trainer.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import pytest
  import logging
  from art.defences.preprocessor import Mixup, Cutout
  from art.defences.trainer import DPInstaHideTrainer
  from art.estimators.classification import PyTorchClassifier, TensorFlowV2Classifier, KerasClassifier
  from tests.utils import ARTTestException
  from tests.utils import get_image_classifier_hf
label_desc: Use image node_id 1 for calling a global function with example usage: get_mnist_classifier(framework) and returns: _get_classifier, classifier