code: def rebin_quantiles(
      quantiles: np.ndarray,
      cumulative_counts: np.ndarray,
      reduction_factor: int,
  ) -> Tuple[np.ndarray, np.ndarray]:
      """Reduces the number of quantiles bins by a factor."""
      x = (cumulative_counts.size - 1) / reduction_factor
      if x != np.floor(x):
          raise ValueError(
              "Reduction factor %d must divide size %d"
              % (reduction_factor, cumulative_counts.size - 1)
          )
  
      low_val, low_count = quantiles[0], cumulative_counts[0]
      quantiles = np.concatenate(
          [[low_val], quantiles[reduction_factor::reduction_factor]]
      )
      cumulative_counts = np.concatenate(
          [
              [low_count],
              cumulative_counts[reduction_factor::reduction_factor],
          ]
      )
      return quantiles, cumulative_counts
  
file_path: data-validation/tensorflow_data_validation/utils/quantiles_util.py
imports: from typing import Tuple
  import numpy
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: rebin_quantiles(quantiles, cumulative_counts, reduction_factor) and returns: quantiles,  cumulative_counts