code: def get_mnist_classifier(framework):
      def _get_classifier():
          if framework == "pytorch":
              import torch
  
              classifier = get_image_classifier_pt()
              optimizer = torch.optim.Adam(
                  classifier.model.parameters(), lr=0.01
              )
              rs = PyTorchRandomizedSmoothing(
                  model=classifier.model,
                  loss=classifier._loss,
                  optimizer=optimizer,
                  input_shape=classifier.input_shape,
                  nb_classes=classifier.nb_classes,
                  channels_first=classifier.channels_first,
                  clip_values=classifier.clip_values,
                  sample_size=100,
                  scale=0.01,
                  alpha=0.001,
              )
  
          elif framework == "tensorflow2":
              classifier, _ = get_image_classifier_tf()
              rs = TensorFlowV2RandomizedSmoothing(
                  model=classifier.model,
                  nb_classes=classifier.nb_classes,
                  input_shape=classifier.input_shape,
                  loss_object=classifier.loss_object,
                  optimizer=classifier.optimizer,
                  train_step=classifier.train_step,
                  channels_first=classifier.channels_first,
                  clip_values=classifier.clip_values,
                  preprocessing_defences=classifier.preprocessing_defences,
                  postprocessing_defences=classifier.postprocessing_defences,
                  preprocessing=classifier.preprocessing,
                  sample_size=100,
                  scale=0.01,
                  alpha=0.001,
              )
  
          elif framework in ("keras", "kerastf"):
              classifier = get_image_classifier_kr()
              rs = NumpyRandomizedSmoothing(
                  classifier=classifier,
                  sample_size=100,
                  scale=0.01,
                  alpha=0.001,
              )
  
          else:
              classifier, rs = None, None
  
          return classifier, rs
  
      return _get_classifier
  
file_path: adversarial-robustness-toolbox/tests/estimators/certification/test_randomized_smoothing.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import pytest
  import numpy
  from art.attacks.evasion.fast_gradient import FastGradientMethod
  from art.estimators.certification.randomized_smoothing import NumpyRandomizedSmoothing, TensorFlowV2RandomizedSmoothing, PyTorchRandomizedSmoothing
  from art.utils import load_dataset, random_targets
  from tests.utils import get_image_classifier_pt, get_image_classifier_tf, get_image_classifier_kr, get_tabular_classifier_pt, ARTTestException
label_desc: Use image node_id 1 for calling a global function with example usage: get_mnist_classifier(framework) and returns: _get_classifier, classifier,  rs