docstr: Return data levels corresponding to quantile cuts of mass.
docstr_tok: ["Return","data","levels","corresponding","to","quantile","cuts","of","mass","."]
code: def _quantile_to_level(self, data, quantile):
      """Return data levels corresponding to quantile cuts of mass."""
      isoprop = np.asarray(quantile)
      values = np.ravel(data)
      sorted_values = np.sort(values)[::-1]
      normalized_values = np.cumsum(sorted_values) / values.sum()
      idx = np.searchsorted(normalized_values, 1 - isoprop)
      levels = np.take(sorted_values, idx, mode="clip")
      return levels
  
imports: from numbers import Number
  from functools import partial
  import math
  import textwrap
  import warnings
  import numpy
  import pandas
  import matplotlib
  import matplotlib.pyplot
  import matplotlib.transforms
  from matplotlib.cbook import normalize_kwargs
  from matplotlib.colors import to_rgba
  from matplotlib.collections import LineCollection
  from ._base import VectorPlotter
  from ._statistics import ECDF, Histogram, KDE
  from ._stats.counting import Hist
  from .axisgrid import FacetGrid, _facet_docs
  from .utils import remove_na, _get_transform_functions, _kde_support, _check_argument, _assign_default_kwargs, _default_color
  from .palettes import color_palette
  from .external import husl
  from .external.kde import gaussian_kde
  from ._docstrings import DocstringComponents, _core_docs
label_desc: Use image node_id 7 for calling the _DistributionPlotter obj's underlying member method code with example usage: obj._quantile_to_level(data, quantile) and returns: levels