class_docstr: Aggregate combine function.
  
  This function really does three things:
    1. Batching of FeaturesPredictionsLabels.
    3. "Partial reduction" of these batches by sending this through the
       "intro metrics" step.
    3. The "normal" combining of MetricVariables.
  
  What we really want to do is conceptually the following:
  Predictions | GroupByKey() | KeyAwareBatchElements()
              | ParDo(IntroMetrics()) | CombineValues(CombineMetricVariables()).
  
  but there's no way to KeyAwareBatchElements in Beam, and no way to do partial
  reductions either. Hence, this CombineFn has to do the work of batching,
  partial reduction (intro metrics), and actual combining, all in one.
  
  We do this by accumulating FeaturesPredictionsLabels in the combine state
  until we accumulate a large enough batch, at which point we send them
  through the "intro metrics" step. When merging, we merge the metric variables
  and accumulate FeaturesPredictionsLabels accordingly. We do one final
  "intro metrics" and merge step before producing the final output value.
  
  See also:
  BEAM-3737: Key-aware batching function
  (https://issues.apache.org/jira/browse/BEAM-3737).
code: def extract_output(
      self, accumulator: _AggState
  ) -> Optional[types.MetricVariablesType]:
      # It's possible that the accumulator has not been fully flushed, if it was
      # not produced by a call to compact (which is not guaranteed across all Beam
      # Runners), or if compact was called on an accumulator with only one value,
      # so we defensively flush it here again, before we extract data from it, to
      # ensure correctness.
      self._maybe_do_batch(accumulator, force=True)
      return accumulator.metric_variables
  
imports: from typing import Any, Dict, Generator, Iterable, List, Optional, Tuple
  import apache_beam
  import numpy
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_metrics_graph import eval_metrics_graph
  from tensorflow_model_analysis.slicer import slicer_lib
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_model_analysis.utils import size_estimator
label_desc: Use image node_id 8 for calling the _AggregateCombineFn obj's underlying member method code with example usage: obj.extract_output(accumulator) and returns: accumulator