class_docstr: Separates metrics and plots into two separate PCollections.
class_docstr_tok: ["Separates","metrics","and","plots","into","two","separate","PCollections","."]
code: def process(
      self, element: Tuple[slicer.SliceKeyType, Dict[str, Any]]
  ):
      (slice_key, results) = element
      slicing_metrics = {}
      plots = {}
      for k, v in results.items():  # pytype: disable=attribute-error
          if metric_keys.is_plot_key(k):
              plots[k] = v
          else:
              slicing_metrics[k] = v
      yield (slice_key, slicing_metrics)
      if plots:
          yield beam.pvalue.TaggedOutput(
              self.OUTPUT_TAG_PLOTS, (slice_key, plots)
          )
  
file_path: model-analysis/tensorflow_model_analysis/evaluators/legacy_metrics_and_plots_evaluator.py
imports: from typing import Any, Dict, Optional, Tuple
  import apache_beam
  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 evaluator
  from tensorflow_model_analysis.evaluators import legacy_aggregate
  from tensorflow_model_analysis.evaluators import legacy_poisson_bootstrap
  from tensorflow_model_analysis.extractors import extractor
  from tensorflow_model_analysis.extractors import slice_key_extractor
  from tensorflow_model_analysis.post_export_metrics import metric_keys
  from tensorflow_model_analysis.slicer import slicer_lib
  from tensorflow_model_analysis.writers import metrics_plots_and_validations_writer
label_desc: Use image node_id 1 for calling the _SeparateMetricsAndPlotsFn obj's underlying member method code with example usage: obj.process(element) without return types