code: def mean_scores_metrics(
      *,
      on_train: bool = True,
      on_eval: bool = True,
      image_creator: Optional[
          MeanScoresImageCreator
      ] = default_mean_scores_image_creator,
  ) -> List[PluginMetric]:
      """
      Helper to create plugins to show the scores of the true class, averaged by
          new and old classes. The plugins are available during training (for the
          last epoch of each experience) and evaluation.
  
      :param on_train: If True the train plugin is created
      :param on_eval: If True the eval plugin is created
      :param image_creator: The function to use to create an image of the history
          of the mean scores grouped by old and new classes
      :return: The list of plugins that were specified
      """
      plugins: List[PluginMetric] = []
  
      if on_eval:
          plugins.append(
              MeanScoresEvalPluginMetric(image_creator=image_creator)
          )
      if on_train:
          plugins.append(
              MeanScoresTrainPluginMetric(image_creator=image_creator)
          )
  
      return plugins
  
imports: from abc import ABC, abstractmethod
  from collections import defaultdict
  from typing import Callable, Dict, Set, TYPE_CHECKING, List, Optional, TypeVar
  import torch
  from matplotlib.axes import Axes
  from matplotlib.figure import Figure
  from matplotlib.pyplot import subplots
  from torch import Tensor, arange
  from avalanche.evaluation import Metric, PluginMetric
  from avalanche.evaluation.metric_utils import get_metric_name
  from avalanche.evaluation.metrics import Mean
  from avalanche.evaluation.metric_results import MetricValue, AlternativeValues
  from typing_extensions import Literal
label_desc: Use image node_id 2 for calling a global function with example usage: mean_scores_metrics() and returns: plugins