code: def ram_usage_metrics(
      *,
      every=1,
      minibatch=False,
      epoch=False,
      experience=False,
      stream=False,
  ) -> List[RAMPluginMetric]:
      """Helper method that can be used to obtain the desired set of
      plugin metrics.
  
      :param every: seconds after which update the maximum RAM
          usage
      :param minibatch: If True, will return a metric able to log the minibatch
          max RAM usage.
      :param epoch: If True, will return a metric able to log the epoch
          max RAM usage.
      :param experience: If True, will return a metric able to log the experience
          max RAM usage.
      :param stream: If True, will return a metric able to log the evaluation
          max stream RAM usage.
  
      :return: A list of plugin metrics.
      """
  
      metrics: List[RAMPluginMetric] = []
      if minibatch:
          metrics.append(MinibatchMaxRAM(every=every))
  
      if epoch:
          metrics.append(EpochMaxRAM(every=every))
  
      if experience:
          metrics.append(ExperienceMaxRAM(every=every))
  
      if stream:
          metrics.append(StreamMaxRAM(every=every))
  
      return metrics
  
imports: import os
  import time
  from typing import Optional, List, TYPE_CHECKING
  from threading import Thread
  from psutil import Process
  from avalanche.evaluation import Metric, PluginMetric, GenericPluginMetric
  from avalanche.evaluation.metric_results import MetricResult
label_desc: Use image node_id 1 for calling a global function with example usage: ram_usage_metrics() and returns: metrics