code: def ks_summary(pareto_tail_indices):
      """Display a summary of Pareto tail indices.
  
      Parameters
      ----------
      pareto_tail_indices : array
        Pareto tail indices.
  
      Returns
      -------
      df_k : dataframe
        Dataframe containing k diagnostic values.
      """
      _numba_flag = Numba.numba_flag
      if _numba_flag:
          bins = np.asarray([-np.Inf, 0.5, 0.7, 1, np.Inf])
          kcounts, *_ = _histogram(pareto_tail_indices, bins)
      else:
          kcounts, *_ = _histogram(
              pareto_tail_indices, bins=[-np.Inf, 0.5, 0.7, 1, np.Inf]
          )
      kprop = kcounts / len(pareto_tail_indices) * 100
      df_k = pd.DataFrame(
          dict(
              _=["(good)", "(ok)", "(bad)", "(very bad)"],
              Count=kcounts,
              Pct=kprop,
          )
      ).rename(
          index={
              0: "(-Inf, 0.5]",
              1: " (0.5, 0.7]",
              2: "   (0.7, 1]",
              3: "   (1, Inf)",
          }
      )
  
      if np.sum(kcounts[1:]) == 0:
          warnings.warn("All Pareto k estimates are good (k < 0.5)")
      elif np.sum(kcounts[2:]) == 0:
          warnings.warn("All Pareto k estimates are ok (k < 0.7)")
  
      return df_k
  
imports: import warnings
  from collections.abc import Sequence
  import numpy
  import packaging
  import pandas
  import scipy
  from scipy import stats
  from ..data import convert_to_dataset
  from ..utils import Numba, _numba_var, _stack, _var_names
  from .density_utils import histogram
  from .stats_utils import _circular_standard_deviation, _sqrt
  from .stats_utils import autocov
  from .stats_utils import not_valid
  from .stats_utils import quantile
  from .stats_utils import stats_variance_2d
  from .stats_utils import wrap_xarray_ufunc
label_desc: Use image node_id 5 for calling a global function with example usage: ks_summary(pareto_tail_indices) and returns: df_k