code: def gpu_usage_metrics(
      gpu_id,
      every=0.5,
      minibatch=False,
      epoch=False,
      experience=False,
      stream=False,
  ) -> List[PluginMetric]:
      """
      Helper method that can be used to obtain the desired set of
      plugin metrics.
  
      :param gpu_id: GPU device ID.
      :param every: seconds after which update the maximum GPU
          usage
      :param minibatch: If True, will return a metric able to log the minibatch
          max GPU usage.
      :param epoch: If True, will return a metric able to log the epoch
          max GPU usage.
      :param experience: If True, will return a metric able to log the experience
          max GPU usage.
      :param stream: If True, will return a metric able to log the evaluation
          max stream GPU usage.
  
      :return: A list of plugin metrics.
      """
  
      metrics: List[PluginMetric] = []
      if minibatch:
          metrics.append(MinibatchMaxGPU(gpu_id, every))
  
      if epoch:
          metrics.append(EpochMaxGPU(gpu_id, every))
  
      if experience:
          metrics.append(ExperienceMaxGPU(gpu_id, every))
  
      if stream:
          metrics.append(StreamMaxGPU(gpu_id, every))
  
      return metrics
  
imports: import GPUtil
  from threading import Thread
  import time
  import warnings
  from typing import Optional, TYPE_CHECKING, List
  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: gpu_usage_metrics(gpu_id, every, minibatch, epoch, experience, stream) and returns: metrics