code: def numeric_segmentation_edges(
      column: pd.Series, max_segments: int
  ) -> np.ndarray:
      """Split given series into values which are used to create quantiles segments.
  
      Tries to create `max_segments + 1` values (since segment is a range, so 2 values needed to create segment) but in
      case some quantiles have the same value they will be filtered, and the result will have less than max_segments + 1
      values.
      """
      percentile_values = np.array([min(column), max(column)])
      attempt_max_segments = max_segments
      prev_percentile_values = deepcopy(percentile_values)
      while len(percentile_values) < max_segments + 1:
          prev_percentile_values = deepcopy(percentile_values)
          percentile_values = pd.unique(
              np.nanpercentile(
                  column.to_numpy(),
                  np.linspace(0, 100, attempt_max_segments + 1),
              )
          )
          if len(percentile_values) == len(prev_percentile_values):
              break
          attempt_max_segments *= 2
  
      if len(percentile_values) > max_segments + 1:
          percentile_values = prev_percentile_values
  
      return percentile_values
  
imports: from collections import defaultdict
  from copy import deepcopy
  from typing import Callable, List, Optional, Tuple, Union
  import numpy
  import pandas
  from sklearn.tree import _tree
  from deepchecks.tabular.dataset import Dataset
  from deepchecks.utils.strings import format_number
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 3 for calling a global function with example usage: numeric_segmentation_edges(column, max_segments) and returns: percentile_values