code: def _kolmogorov_smirnov(dist, data):
      x = np.sort(data, axis=-1)
      cdfvals = dist.cdf(x)
      Dplus = _compute_dplus(cdfvals)  # always works along last axis
      Dminus = _compute_dminus(cdfvals)
      return np.maximum(Dplus, Dminus)
  
imports: import warnings
  from collections import namedtuple
  import numpy
  from scipy import optimize, stats
  from scipy._lib._util import check_random_state
label_desc: Use image node_id 9 for calling a global function with example usage: _kolmogorov_smirnov(dist, data) and returns: np