code: def MetricsPlotsAndValidationsEvaluator(  # pylint: disable=invalid-name
      eval_config: config_pb2.EvalConfig,
      eval_shared_model: Optional[
          types.MaybeMultipleEvalSharedModels
      ] = None,
      metrics_key: str = constants.METRICS_KEY,
      plots_key: str = constants.PLOTS_KEY,
      attributions_key: str = constants.ATTRIBUTIONS_KEY,
      run_after: str = slice_key_extractor.SLICE_KEY_EXTRACTOR_STAGE_NAME,
      schema: Optional[schema_pb2.Schema] = None,
      random_seed_for_testing: Optional[int] = None,
  ) -> evaluator.Evaluator:
      """Creates an Evaluator for evaluating metrics and plots.
  
      Args:
        eval_config: Eval config.
        eval_shared_model: Optional shared model (single-model evaluation) or list
          of shared models (multi-model evaluation). Only required if there are
          metrics to be computed in-graph using the model.
        metrics_key: Name to use for metrics key in Evaluation output.
        plots_key: Name to use for plots key in Evaluation output.
        attributions_key: Name to use for attributions key in Evaluation output.
        run_after: Extractor to run after (None means before any extractors).
        schema: A schema to use for customizing metrics and plots.
        random_seed_for_testing: Seed to use for unit testing.
  
      Returns:
        Evaluator for evaluating metrics and plots. The output will be stored under
        'metrics' and 'plots' keys.
      """
      eval_shared_models = (
          model_util.verify_and_update_eval_shared_models(
              eval_shared_model
          )
      )
      if eval_shared_models:
          eval_shared_models = {
              m.model_name: m for m in eval_shared_models
          }
  
      # pylint: disable=no-value-for-parameter
      return evaluator.Evaluator(
          stage_name="EvaluateMetricsAndPlots",
          run_after=run_after,
          ptransform=_EvaluateMetricsPlotsAndValidations(
              eval_config=eval_config,
              eval_shared_models=eval_shared_models,
              metrics_key=metrics_key,
              plots_key=plots_key,
              attributions_key=attributions_key,
              schema=schema,
              random_seed_for_testing=random_seed_for_testing,
          ),
      )
  
imports: import copy
  import datetime
  import itertools
  import numbers
  from typing import Any, Dict, Iterable, Iterator, List, NamedTuple, Optional, Tuple, Type, TypeVar, Union
  import apache_beam
  import numpy
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.evaluators import counter_util
  from tensorflow_model_analysis.evaluators import eval_saved_model_util
  from tensorflow_model_analysis.evaluators import evaluator
  from tensorflow_model_analysis.evaluators import jackknife
  from tensorflow_model_analysis.evaluators import keras_util
  from tensorflow_model_analysis.evaluators import metrics_validator
  from tensorflow_model_analysis.evaluators import poisson_bootstrap
  from tensorflow_model_analysis.extractors import slice_key_extractor
  from tensorflow_model_analysis.metrics import metric_specs
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.slicer import slicer_lib
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_model_analysis.utils import util
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: MetricsPlotsAndValidationsEvaluator(eval_config, eval_shared_model, metrics_key, plots_key, attributions_key, run_after, schema, random_seed_for_testing) and returns: evaluator