code: def smooth_data(obs_vals, pp_vals):
      """Smooth data using a cubic spline.
  
      Helper function for discrete data in plot_pbv, loo_pit and plot_loo_pit.
  
      Parameters
      ----------
      obs_vals : (N) array-like
          Observed data
      pp_vals : (S, N) array-like
          Posterior predictive samples. ``N`` is the number of observations,
          and ``S`` is the number of samples (generally n_chains*n_draws).
  
      Returns
      -------
      obs_vals : (N) ndarray
          Smoothed observed data
      pp_vals : (S, N) ndarray
          Smoothed posterior predictive samples
      """
      x = np.linspace(0, 1, len(obs_vals))
      csi = CubicSpline(x, obs_vals)
      obs_vals = csi(np.linspace(0.01, 0.99, len(obs_vals)))
  
      x = np.linspace(0, 1, pp_vals.shape[1])
      csi = CubicSpline(x, pp_vals, axis=1)
      pp_vals = csi(np.linspace(0.01, 0.99, pp_vals.shape[1]))
  
      return obs_vals, pp_vals
  
imports: import warnings
  from collections.abc import Sequence
  from copy import copy
  from copy import deepcopy
  import numpy
  import pandas
  from scipy.fftpack import next_fast_len
  from scipy.interpolate import CubicSpline
  from scipy.stats.mstats import mquantiles
  from xarray import apply_ufunc
  from ..None import _log
  from ..utils import conditional_jit, conditional_vect, conditional_dask
  from .density_utils import histogram
label_desc: Use image node_id 16 for calling a global function with example usage: smooth_data(obs_vals, pp_vals) and returns: obs_vals,  pp_vals