code: def setup(self, training_metrics: Dict):
      def metric_name(n) -> str:
          if n.endswith("Accuracy"):
              n = "acc"
          else:
              n = n[:-6] if n.endswith("Metric") else n
          return n
  
      def print_metrics(metrics) -> str:
          rv = ""
          metric_keys = sorted(k for k in metrics)
          for k in metric_keys:
              if k == "Accuracy":
                  rv += f"{metric_name(k)}: {metrics[k]:.3} | "
              else:
                  rv += f"{metric_name(k)}: {metrics[k]} | "
          return rv
  
      def store_metrics(metrics: Dict, mode: str):
          metric_keys = sorted(k for k in metrics)
          for k in metric_keys:
              self.metrics_history[mode][metric_name(k)].append(
                  metrics[k]
              )
  
      if self.seed:
          set_seed_everywhere(self.seed, self.cuda)
  
      pbar = ProgressBar(persist=True)
  
      names = []
      for k, v in training_metrics.items():
          name = f"r{k}"
          names.append(name)
          RunningAverage(v).attach(self.trainer, name)
      RunningAverage(None, output_transform=lambda x: x[-1]).attach(
          self.trainer, "rloss"
      )
  
      names.append("rloss")
      pbar.attach(self.trainer, names)
  
      ProgressBar(persist=True).attach(
          engine=self.evaluator, metric_names=names
      )
  
      # A few events handler. To add / modify the events handler, you need to extend the __init__ method of RunnerABC
      # Ignite provides the necessary abstractions and a furnished repository of useful tools
  
      @self.trainer.on(Events.EPOCH_COMPLETED)
      def log_training_validation_results(trainer):
          self.evaluator.run(self.dataset_splits.train_data_loader())
          metrics = self.evaluator.state.metrics
          store_metrics(metrics=metrics, mode="training")
          logger.info(
              f"Training Results - Epoch: {trainer.state.epoch} {print_metrics(metrics)}"
          )
  
          self.evaluator.run(self.dataset_splits.val_data_loader())
          metrics = self.evaluator.state.metrics
          store_metrics(metrics=metrics, mode="validation")
          logger.info(
              f"Validation Results - Epoch: {trainer.state.epoch} {print_metrics(metrics)}"
          )
  
          metrics = self.trainer.state.metrics
          if self.scheduler:
              self.scheduler.step(metrics["rloss"])
              # self.scheduler.step(metrics[self.loss_metric.__class__.__name__])
  
      @self.trainer.on(Events.COMPLETED)
      def log_test_results(trainer):
          if self.dataset_splits.test_set:
              self.evaluator.run(self.dataset_splits.test_data_loader())
              metrics = self.evaluator.state.metrics
              store_metrics(metrics=metrics, mode="test")
              logger.info(
                  f"Test Results - Epoch: {trainer.state.epoch} {print_metrics(metrics)}"
              )
  
imports: import inspect
  import logging
  import re
  from abc import abstractmethod
  from collections import defaultdict
  from typing import Dict, List, Any, Union, Tuple
  import numpy
  import torch
  import torch.nn
  import torch.optim
  from ignite.contrib.handlers.tensorboard_logger import TensorboardLogger, OutputHandler, OptimizerParamsHandler, WeightsScalarHandler, WeightsHistHandler, GradsScalarHandler
  from ignite.contrib.handlers.tqdm_logger import ProgressBar
  from ignite.engine import Events
  from ignite.engine.engine import Engine
  from ignite.metrics import Loss, Metric, RunningAverage, MetricsLambda, Accuracy
  from ignite.utils import convert_tensor
  from transfer_nlp.loaders.loaders import DatasetSplits
  from transfer_nlp.plugins.config import register_plugin
  from transfer_nlp.plugins.regularizers import RegularizerABC
  from transfer_nlp.plugins.trainer_abc import TrainerABC
label_desc: Use image node_id 2 for calling the BaseIgniteTrainer obj's underlying member method code with example usage: obj.setup(training_metrics) and returns: n, rv