class_docstr: Manager for logging and metrics.
  
  An evaluation plugin that obtains relevant data from the
  training and eval loops of the strategy through callbacks.
  The plugin keeps a dictionary with the last recorded value for each metric.
  The dictionary will be returned by the `train` and `eval` methods of the
  strategies.
  It is also possible to keep a dictionary with all recorded metrics by
  specifying `collect_all=True`. The dictionary can be retrieved via
  the `get_all_metrics` method.
  
  This plugin also logs metrics using the provided loggers.
class_docstr_tok: ["Manager","for","logging","and","metrics",".","An","evaluation","plugin","that","obtains","relevant","data","from","the","training","and","eval","loops","of","the","strategy","through","callbacks",".","The","plugin","keeps","a","dictionary","with","the","last","recorded","value","for","each","metric",".","The","dictionary","will","be","returned","by","the","`","train","`","and","`","eval","`","methods","of","the","strategies",".","It","is","also","possible","to","keep","a","dictionary","with","all","recorded","metrics","by","specifying","`","collect_all=True","`",".","The","dictionary","can","be","retrieved","via","the","`","get_all_metrics","`","method",".","This","plugin","also","logs","metrics","using","the","provided","loggers","."]
code: def before_eval(self, strategy: "SupervisedTemplate", **kwargs):
      self._update_metrics_and_loggers(strategy, "before_eval")
      msge = (
          "Stream provided to `eval` must be the same of the entire "
          "evaluation stream."
      )
      if self.strict_checks:
          curr_stream = next(
              iter(strategy.current_eval_stream)
          ).origin_stream
          benchmark = curr_stream[0].origin_stream.benchmark
          full_stream = benchmark.streams[curr_stream.name]
  
          if len(curr_stream) != len(full_stream):
              raise ValueError(msge)
  
imports: import warnings
  from copy import copy
  from collections import defaultdict
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence, TYPE_CHECKING
  from avalanche.distributed.distributed_helper import DistributedHelper
  from avalanche.evaluation.metric_results import MetricValue
  from avalanche.evaluation.metrics import accuracy_metrics, loss_metrics
  from avalanche.logging import InteractiveLogger
label_desc: Use image node_id 10 for calling the EvaluationPlugin obj's underlying member method code with example usage: obj.before_eval(strategy) without return types