code: def idealfourths(data, axis=None):
      """
      Returns an estimate of the lower and upper quartiles.
  
      Uses the ideal fourths algorithm.
  
      Parameters
      ----------
      data : array_like
          Input array.
      axis : int, optional
          Axis along which the quartiles are estimated. If None, the arrays are
          flattened.
  
      Returns
      -------
      idealfourths : {list of floats, masked array}
          Returns the two internal values that divide `data` into four parts
          using the ideal fourths algorithm either along the flattened array
          (if `axis` is None) or along `axis` of `data`.
  
      """
  
      def _idf(data):
          x = data.compressed()
          n = len(x)
          if n < 3:
              return [np.nan, np.nan]
          (j, h) = divmod(n / 4.0 + 5 / 12.0, 1)
          j = int(j)
          qlo = (1 - h) * x[j - 1] + h * x[j]
          k = n - j
          qup = (1 - h) * x[k] + h * x[k - 1]
          return [qlo, qup]
  
      data = ma.sort(data, axis=axis).view(MaskedArray)
      if axis is None:
          return _idf(data)
      else:
          return ma.apply_along_axis(_idf, axis, data)
  
file_path: catboost/contrib/python/scipy/py2/scipy/stats/mstats_extras.py
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy import float_, int_, ndarray
  import numpy.ma
  from numpy.ma import MaskedArray
  from .None import mstats_basic
  from scipy.stats.distributions import norm, beta, t, binom
label_desc: Use image node_id 9 for calling a global function with example usage: idealfourths(data, axis) and returns: list, _idf, ma, list