code: def get_adv_trainer_oaat(framework, image_dl_estimator):
      def _get_adv_trainer_oaat():
          if framework == "keras":
              trainer = None
          if framework in ["tensorflow", "tensorflow2v1"]:
              trainer = None
          if framework == "pytorch":
              classifier, _ = image_dl_estimator(from_logits=True)
              proxy_classifier, _ = image_dl_estimator(from_logits=True)
              lpips_classifier, _ = image_dl_estimator(from_logits=True)
              list_avg_classifiers = [
                  image_dl_estimator(from_logits=True)[0]
                  for _ in range(3)
              ]
              train_params = {
                  "weight_decay": 0.0,
                  "lr": 0.1,
                  "momentum": 0.0,
                  "norm": np.inf,
                  "i_epsilon": 0.1,
                  "epsilon": 0.2,
                  "alpha": 1.0,
                  "beta": 1.5,
                  "awp_gamma": 0.005,
                  "awp_warmup": 1,
                  "lr_schedule": "cosine",
                  "beta_final": 3.0,
                  "mixup_alpha": 0.2,
                  "mixup_epsilon": 0.25,
                  "lpips_weight": 1.0,
                  "list_swa_tau": [0.995, 0.9996, 0.9998],
                  "oaat_warmup": 0,
                  "alternate_iter_eps": 0.15,
                  "swa_save_epoch": 0,
                  "list_swa_epoch": [0, 15, 15],
                  "max_iter": 20,
                  "models_path": None,
                  "load_swa_model_tau": 0.995,
                  "layer_names_activation": ["conv"],
              }
  
              attack = ProjectedGradientDescent(
                  classifier,
                  norm=np.inf,
                  eps=0.2,
                  eps_step=0.02,
                  max_iter=20,
                  targeted=False,
                  num_random_init=1,
                  batch_size=16,
                  verbose=False,
              )
              trainer = AdversarialTrainerOAATPyTorch(
                  classifier,
                  proxy_classifier,
                  lpips_classifier,
                  list_avg_classifiers,
                  attack,
                  train_params,
              )
          if framework == "scikitlearn":
              trainer = None
  
          return trainer
  
      return _get_adv_trainer_oaat
  
file_path: adversarial-robustness-toolbox/tests/defences/trainer/test_adversarial_trainer_oaat_pytorch.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import pytest
  import logging
  import numpy
  from art.defences.trainer import AdversarialTrainerOAATPyTorch
  from art.attacks.evasion import ProjectedGradientDescent
label_desc: Use image node_id 1 for calling a global function with example usage: get_adv_trainer_oaat(framework, image_dl_estimator) and returns: _get_adv_trainer_oaat, trainer