code: def _find_binning_thresholds(col_data, max_bins):
      """Extract quantiles from a continuous feature.
  
      Missing values are ignored for finding the thresholds.
  
      Parameters
      ----------
      col_data : array-like, shape (n_samples,)
          The continuous feature to bin.
      max_bins: int
          The maximum number of bins to use for non-missing values. If for a
          given feature the number of unique values is less than ``max_bins``,
          then those unique values will be used to compute the bin thresholds,
          instead of the quantiles
  
      Return
      ------
      binning_thresholds : ndarray of shape(min(max_bins, n_unique_values) - 1,)
          The increasing numeric values that can be used to separate the bins.
          A given value x will be mapped into bin value i iff
          bining_thresholds[i - 1] < x <= binning_thresholds[i]
      """
      # ignore missing values when computing bin thresholds
      missing_mask = np.isnan(col_data)
      if missing_mask.any():
          col_data = col_data[~missing_mask]
      col_data = np.ascontiguousarray(col_data, dtype=X_DTYPE)
      distinct_values = np.unique(col_data)
      if len(distinct_values) <= max_bins:
          midpoints = distinct_values[:-1] + distinct_values[1:]
          midpoints *= 0.5
      else:
          # We sort again the data in this case. We could compute
          # approximate midpoint percentiles using the output of
          # np.unique(col_data, return_counts) instead but this is more
          # work and the performance benefit will be limited because we
          # work on a fixed-size subsample of the full data.
          percentiles = np.linspace(0, 100, num=max_bins + 1)
          percentiles = percentiles[1:-1]
          midpoints = percentile(
              col_data, percentiles, method="midpoint"
          ).astype(X_DTYPE)
          assert midpoints.shape[0] == max_bins - 1
  
      # We avoid having +inf thresholds: +inf thresholds are only allowed in
      # a "split on nan" situation.
      np.clip(midpoints, a_min=None, a_max=ALMOST_INF, out=midpoints)
      return midpoints
  
file_path: catboost/contrib/python/scikit-learn/py3/sklearn/ensemble/_hist_gradient_boosting/binning.py
imports: import numpy
  from ...base import BaseEstimator, TransformerMixin
  from ...utils import check_array, check_random_state
  from ...utils._openmp_helpers import _openmp_effective_n_threads
  from ...utils.fixes import percentile
  from ...utils.validation import check_is_fitted
  from ._binning import _map_to_bins
  from ._bitset import set_bitset_memoryview
  from .common import ALMOST_INF, X_BINNED_DTYPE, X_BITSET_INNER_DTYPE, X_DTYPE
label_desc: Use image node_id 1 for calling a global function with example usage: _find_binning_thresholds(col_data, max_bins) and returns: midpoints