code: def _cubicspline_interpolate(
      xi,
      yi,
      x,
      axis: AxisInt = 0,
      bc_type: str | tuple[Any, Any] = "not-a-knot",
      extrapolate=None,
  ):
      """
      Convenience function for cubic spline data interpolator.
  
      See `scipy.interpolate.CubicSpline` for details.
  
      Parameters
      ----------
      xi : array-like, shape (n,)
          1-d array containing values of the independent variable.
          Values must be real, finite and in strictly increasing order.
      yi : array-like
          Array containing values of the dependent variable. It can have
          arbitrary number of dimensions, but the length along ``axis``
          (see below) must match the length of ``x``. Values must be finite.
      x : scalar or array-like, shape (m,)
      axis : int, optional
          Axis along which `y` is assumed to be varying. Meaning that for
          ``x[i]`` the corresponding values are ``np.take(y, i, axis=axis)``.
          Default is 0.
      bc_type : string or 2-tuple, optional
          Boundary condition type. Two additional equations, given by the
          boundary conditions, are required to determine all coefficients of
          polynomials on each segment [2]_.
          If `bc_type` is a string, then the specified condition will be applied
          at both ends of a spline. Available conditions are:
          * 'not-a-knot' (default): The first and second segment at a curve end
            are the same polynomial. It is a good default when there is no
            information on boundary conditions.
          * 'periodic': The interpolated functions is assumed to be periodic
            of period ``x[-1] - x[0]``. The first and last value of `y` must be
            identical: ``y[0] == y[-1]``. This boundary condition will result in
            ``y'[0] == y'[-1]`` and ``y''[0] == y''[-1]``.
          * 'clamped': The first derivative at curves ends are zero. Assuming
            a 1D `y`, ``bc_type=((1, 0.0), (1, 0.0))`` is the same condition.
          * 'natural': The second derivative at curve ends are zero. Assuming
            a 1D `y`, ``bc_type=((2, 0.0), (2, 0.0))`` is the same condition.
          If `bc_type` is a 2-tuple, the first and the second value will be
          applied at the curve start and end respectively. The tuple values can
          be one of the previously mentioned strings (except 'periodic') or a
          tuple `(order, deriv_values)` allowing to specify arbitrary
          derivatives at curve ends:
          * `order`: the derivative order, 1 or 2.
          * `deriv_value`: array-like containing derivative values, shape must
            be the same as `y`, excluding ``axis`` dimension. For example, if
            `y` is 1D, then `deriv_value` must be a scalar. If `y` is 3D with
            the shape (n0, n1, n2) and axis=2, then `deriv_value` must be 2D
            and have the shape (n0, n1).
      extrapolate : {bool, 'periodic', None}, optional
          If bool, determines whether to extrapolate to out-of-bounds points
          based on first and last intervals, or to return NaNs. If 'periodic',
          periodic extrapolation is used. If None (default), ``extrapolate`` is
          set to 'periodic' for ``bc_type='periodic'`` and to True otherwise.
  
      See Also
      --------
      scipy.interpolate.CubicHermiteSpline
  
      Returns
      -------
      y : scalar or array-like
          The result, of shape (m,)
  
      References
      ----------
      .. [1] `Cubic Spline Interpolation
              <https://en.wikiversity.org/wiki/Cubic_Spline_Interpolation>`_
              on Wikiversity.
      .. [2] Carl de Boor, "A Practical Guide to Splines", Springer-Verlag, 1978.
      """
      from scipy import interpolate
  
      P = interpolate.CubicSpline(
          xi, yi, axis=axis, bc_type=bc_type, extrapolate=extrapolate
      )
  
      return P(x)
  
imports: from __future__ import annotations
  from functools import partial, wraps
  from typing import TYPE_CHECKING, Any, cast
  import numpy
  from pandas._libs import NaT, algos, lib
  from pandas._typing import ArrayLike, Axis, AxisInt, F, npt
  from pandas.compat._optional import import_optional_dependency
  from pandas.core.dtypes.cast import infer_dtype_from
  from pandas.core.dtypes.common import is_array_like, is_numeric_v_string_like, is_object_dtype, needs_i8_conversion
  from pandas.core.dtypes.missing import is_valid_na_for_dtype, isna, na_value_for_dtype
label_desc: Use image node_id 13 for calling a global function with example usage: _cubicspline_interpolate(xi, yi, x, axis, bc_type, extrapolate) and returns: P