code: def find_median(quantiles: np.ndarray) -> float:
      """Find median from the quantile boundaries.
  
      Args:
        quantiles: A numpy array containing the quantile boundaries.
  
      Returns:
        The median.
      """
      num_quantiles = len(quantiles)
      # We assume that we have at least one quantile boundary.
      assert num_quantiles > 0
  
      median_index = int(num_quantiles / 2)
      if num_quantiles % 2 == 0:
          # If we have an even number of quantile boundaries, take the mean of the
          # middle boundaries to be the median.
          return (
              quantiles[median_index - 1] + quantiles[median_index]
          ) / 2.0
      else:
          # If we have an odd number of quantile boundaries, the middle boundary is
          # the median.
          return quantiles[median_index]
  
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 1 for calling a global function with example usage: find_median(quantiles) and returns: unknown, quantiles