code: def before_training_exp(self, strategy, **kwargs):
      super().before_training_exp(strategy, **kwargs)
      if isinstance(strategy.experience, OnlineCLExperience):
          new_classes = set(
              strategy.experience.logging().origin_experience.classes_in_this_experience
          )
  
          task_id = (
              strategy.experience.logging().origin_experience.current_experience
          )
      else:
          new_classes = set(
              strategy.experience.classes_in_this_experience
          )
          task_id = strategy.experience.current_experience
  
      self.classes_seen_so_far = self.classes_seen_so_far.union(
          new_classes
      )
      self.classes_splits[task_id] = self.classes_seen_so_far
  
imports: from collections import defaultdict
  from typing import Dict, List, Union, TYPE_CHECKING
  import numpy
  import torch
  from torch import Tensor
  from avalanche.benchmarks import OnlineCLExperience
  from avalanche.evaluation import GenericPluginMetric, Metric, PluginMetric
  from avalanche.evaluation.metrics.mean import Mean
  from avalanche.evaluation.metric_utils import phase_and_task, stream_type, generic_get_metric_name, default_metric_name_template
  from avalanche.evaluation.metric_results import MetricValue
label_desc: Use image node_id 2 for calling the CumulativeAccuracyPluginMetric obj's underlying member method code with example usage: obj.before_training_exp(strategy) without return types