def splev(x, tck, der=<NUM_LIT:0>, ext=<NUM_LIT:0>):
t,c,k = tck<EOL>try:<EOL><INDENT>c[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>parametric = True<EOL><DEDENT>except:<EOL><INDENT>parametric = False<EOL><DEDENT>if parametric:<EOL><INDENT>return list(map(lambda c, x=x, t=t, k=k, der=der: splev(x, [t,c,k], der, ext), c))<EOL><DEDENT>else:<EOL><INDENT>if not (<NUM_LIT:0> <= der <= k):<EOL><INDENT>raise ValueError("<STR_LIT>" % (der,k))<EOL><DEDENT>if ext not in (<NUM_LIT:0>, <NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:3>):<EOL><INDENT>raise ValueError("<STR_LIT>" % ext)<EOL><DEDENT>x = asarray(x)<EOL>shape = x.shape<EOL>x = atleast_1d(x).ravel()<EOL>y, ier = _fitpack._spl_(x, der, t, c, k, ext)<EOL>if ier == <NUM_LIT:10>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if ier == <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if ier:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>return y.reshape(shape)<EOL><DEDENT>
Evaluate a B-spline or its derivatives.

Given the knots and coefficients of a B-spline representation, evaluate
the value of the smoothing polynomial and its derivatives.  This is a
wrapper around the FORTRAN routines splev and splder of FITPACK.

Parameters
----------
x : array_like
    An array of points at which to return the value of the smoothed
    spline or its derivatives.  If `tck` was returned from `splprep`,
    then the parameter values, u should be given.
tck : tuple
    A sequence of length 3 returned by `splrep` or `splprep` containing
    the knots, coefficients, and degree of the spline.
der : int
    The order of derivative of the spline to compute (must be less than
    or equal to k).
ext : int
    Controls the value returned for elements of ``x`` not in the
    interval defined by the knot sequence.

    * if ext=0, return the extrapolated value.
    * if ext=1, return 0
    * if ext=2, raise a ValueError
    * if ext=3, return the boundary value.

    The default value is 0.

Returns
-------
y : ndarray or list of ndarrays
    An array of values representing the spline function evaluated at
    the points in ``x``.  If `tck` was returned from `splprep`, then this
    is a list of arrays representing the curve in N-dimensional space.

See Also
--------
splprep, splrep, sproot, spalde, splint
bisplrep, bisplev

References
----------
.. [1] C. de Boor, "On calculating with b-splines", J. Approximation
    Theory, 6, p.50-62, 1972.
.. [2] M.G. Cox, "The numerical evaluation of b-splines", J. Inst. Maths
    Applics, 10, p.134-149, 1972.
.. [3] P. Dierckx, "Curve and surface fitting with splines", Monographs
    on Numerical Analysis, Oxford University Press, 1993.