class_docstr: Base class for piecewise polynomials.
class_docstr_tok: ["Base","class","for","piecewise","polynomials","."]
docstr: Evaluate the piecewise polynomial or its derivative.
  
  Parameters
  ----------
  x : array_like
      Points to evaluate the interpolant at.
  nu : int, optional
      Order of derivative to evaluate. Must be non-negative.
  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), use `self.extrapolate`.
  
  Returns
  -------
  y : array_like
      Interpolated values. Shape is determined by replacing
      the interpolation axis in the original array with the shape of x.
  
  Notes
  -----
  Derivatives are evaluated piecewise for each polynomial
  segment, even if the polynomial is not differentiable at the
  breakpoints. The polynomial intervals are considered half-open,
  ``[a, b)``, except for the last interval which is closed
  ``[a, b]``.
code: def __call__(self, x, nu=0, extrapolate=None):
      """
      Evaluate the piecewise polynomial or its derivative.
  
      Parameters
      ----------
      x : array_like
          Points to evaluate the interpolant at.
      nu : int, optional
          Order of derivative to evaluate. Must be non-negative.
      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), use `self.extrapolate`.
  
      Returns
      -------
      y : array_like
          Interpolated values. Shape is determined by replacing
          the interpolation axis in the original array with the shape of x.
  
      Notes
      -----
      Derivatives are evaluated piecewise for each polynomial
      segment, even if the polynomial is not differentiable at the
      breakpoints. The polynomial intervals are considered half-open,
      ``[a, b)``, except for the last interval which is closed
      ``[a, b]``.
      """
      if extrapolate is None:
          extrapolate = self.extrapolate
      x = cupy.asarray(x)
      x_shape, x_ndim = x.shape, x.ndim
      x = cupy.ascontiguousarray(x.ravel(), dtype=cupy.float_)
  
      # With periodic extrapolation we map x to the segment
      # [self.x[0], self.x[-1]].
      if extrapolate == "periodic":
          x = self.x[0] + (x - self.x[0]) % (self.x[-1] - self.x[0])
          extrapolate = False
  
      out = cupy.empty(
          (len(x), int(np.prod(self.c.shape[2:]))), dtype=self.c.dtype
      )
      self._ensure_c_contiguous()
      self._evaluate(x, nu, extrapolate, out)
      out = out.reshape(x_shape + self.c.shape[2:])
      if self.axis != 0:
          # transpose to move the calculated values to the interpolation axis
          dims = list(range(out.ndim))
          dims = (
              dims[x_ndim : x_ndim + self.axis]
              + dims[:x_ndim]
              + dims[x_ndim + self.axis :]
          )
          out = out.transpose(dims)
      return out
  
imports: import math
  import cupy
  from cupy._core import internal
  from cupy._core._scalar import get_typename
  from cupy_backends.cuda.api import runtime
  from cupyx.scipy import special
  from cupyx.scipy.interpolate._bspline import BSpline, _get_dtype
  import numpy
label_desc: Use image node_id 6 for calling the _PPolyBase obj's underlying member method code with example usage: obj.__call__(x, nu, extrapolate) and returns: out