'Evaluate a spline function.
Parameters
x : array_like
points to evaluate the spline at.
nu: int, optional
derivative to evaluate (default is 0).
extrapolate : bool or \'periodic\', optional
whether to extrapolate based on the first and last intervals
or return nans. If \'periodic\', periodic extrapolation is used.
Default is `self.extrapolate`.
Returns
y : array_like
Shape is determined by replacing the interpolation axis
in the coefficient array with the shape of `x`.'

def __call__(self, x, nu=0, extrapolate=None):

    if (extrapolate is None):
        extrapolate = self.extrapolate
    x = np.asarray(x)
    (x_shape, x_ndim) = (x.shape, x.ndim)
    x = np.ascontiguousarray(x.ravel(), dtype=np.float_)
    if (extrapolate == 'periodic'):
        n = ((self.t.size - self.k) - 1)
        x = (self.t[self.k] + ((x - self.t[self.k]) % (self.t[n] - self.t[self.k])))
        extrapolate = False
    out = np.empty((len(x), prod(self.c.shape[1:])), dtype=self.c.dtype)
    self._ensure_c_contiguous()
    self._evaluate(x, nu, extrapolate, out)
    out = out.reshape((x_shape + self.c.shape[1:]))
    if (self.axis != 0):
        l = list(range(out.ndim))
        l = ((l[x_ndim:(x_ndim + self.axis)] + l[:x_ndim]) + l[(x_ndim + self.axis):])
        out = out.transpose(l)
    return out
