code: def merge_summaries(prev_summary, next_summary, epsilon):
      """Weighted merge sort of summaries.
  
      Given two summaries of distinct data, this function merges (and compresses)
      them to stay within `epsilon` error tolerance.
  
      Args:
          prev_summary: 2D `np.ndarray` summary to be merged with `next_summary`.
          next_summary: 2D `np.ndarray` summary to be merged with `prev_summary`.
          epsilon: A float that determines the approxmiate desired precision.
  
      Returns:
          A 2-D `np.ndarray` that is a merged summary. First column is the
          interpolated partition values, the second is the weights (counts).
      """
      merged = np.concatenate((prev_summary, next_summary), axis=1)
      merged = np.take(merged, np.argsort(merged[0]), axis=1)
      return compress_summary(merged, epsilon)
  
imports: import numpy
  from keras import backend
  from keras.api_export import keras_export
  from keras.layers.preprocessing.tf_data_layer import TFDataLayer
  from keras.utils import argument_validation
  from keras.utils import numerical_utils
  from keras.utils.module_utils import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: merge_summaries(prev_summary, next_summary, epsilon) and returns: compress_summary