code: def topk_acc_metrics(
      *,
      top_k=3,
      minibatch=False,
      epoch=False,
      epoch_running=False,
      experience=False,
      trained_experience=False,
      stream=False,
  ) -> List[TopkAccuracyPluginMetric]:
      """
      Helper method that can be used to obtain the desired set of
      plugin metrics.
  
      :param minibatch: If True, will return a metric able to log
          the minibatch top-k accuracy at training time.
      :param epoch: If True, will return a metric able to log
          the epoch top-k accuracy at training time.
      :param epoch_running: If True, will return a metric able to log
          the running epoch top-k accuracy at training time.
      :param experience: If True, will return a metric able to log
          the top-k accuracy on each evaluation experience.
      :param trained_experience: If True, will return a metric able to log
          the average evaluation top-k accuracy only for experiences that the
          model has been trained on
      :param stream: If True, will return a metric able to log the top-k accuracy
          averaged over the entire evaluation stream of experiences.
  
      :return: A list of plugin metrics.
      """
  
      metrics: List[TopkAccuracyPluginMetric] = []
      if minibatch:
          metrics.append(MinibatchTopkAccuracy(top_k=top_k))
      if epoch:
          metrics.append(EpochTopkAccuracy(top_k=top_k))
      if epoch_running:
          metrics.append(RunningEpochTopkAccuracy(top_k=top_k))
      if experience:
          metrics.append(ExperienceTopkAccuracy(top_k=top_k))
      if trained_experience:
          metrics.append(TrainedExperienceTopkAccuracy(top_k=top_k))
      if stream:
          metrics.append(StreamTopkAccuracy(top_k=top_k))
  
      return metrics
  
imports: from typing import TYPE_CHECKING, List, Union, Dict
  import torch
  from torch import Tensor
  import torchmetrics
  from torchmetrics.functional import accuracy
  from avalanche.evaluation import Metric, GenericPluginMetric
  from avalanche.evaluation.metrics.mean import Mean
  from avalanche.evaluation.metric_utils import phase_and_task
  from collections import defaultdict
  from packaging import version
label_desc: Use image node_id 1 for calling a global function with example usage: topk_acc_metrics() and returns: metrics