class_docstr: CombineFn to create query examples for each query id.
  
  Note that this assumes the number of examples for each query ID is small
  enough to fit in memory.
code: def extract_output(
      self, accumulator: List[types.Extracts]
  ) -> query_types.QueryFPL:
      def fpl_from_extracts(
          extract: types.Extracts,
      ) -> query_types.FPL:  # pylint: disable=invalid-name
          """Make an FPL from an extract."""
  
          fpl = extract[constants.FEATURES_PREDICTIONS_LABELS_KEY]
  
          # Unwrap the FPL to get dictionaries like
          # features['feature1'] = [['ex1value1', 'ex1value2'], ['ex2value1', '']]
          # features['feature2'] = [[1], [2]]
          features = {
              k: v[encoding.NODE_SUFFIX]
              for k, v in fpl.features.items()
          }
          predictions = {
              k: v[encoding.NODE_SUFFIX]
              for k, v in fpl.predictions.items()
          }
          labels = {
              k: v[encoding.NODE_SUFFIX] for k, v in fpl.labels.items()
          }
  
          return dict(
              features=features, predictions=predictions, labels=labels
          )
  
      unsorted_fpls = [
          fpl_from_extracts(extract) for extract in accumulator
      ]
  
      if not unsorted_fpls:
          return query_types.QueryFPL(fpls=[], query_id="")
  
      # Sort result in descending order of prediction
      sort_keys = np.array(
          [
              x["predictions"][self._prediction_key][0][0]
              for x in unsorted_fpls
          ]
      )
      sort_indices = np.argsort(sort_keys)[::-1]
  
      sorted_fpls = []
      for index in sort_indices:
          sorted_fpls.append(unsorted_fpls[index])
  
      # Query ID will be filled in later
      return query_types.QueryFPL(fpls=sorted_fpls, query_id="")
  
imports: from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import constants
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.eval_saved_model import util
  from tensorflow_model_analysis.evaluators import evaluator
  from tensorflow_model_analysis.evaluators.query_metrics import query_types
  from tensorflow_model_analysis.extractors import extractor
  from tensorflow_model_analysis.extractors import slice_key_extractor
label_desc: Use image node_id 5 for calling the CreateQueryExamples obj's underlying member method code with example usage: obj.extract_output(accumulator) and returns: query_types, dict, query_types