<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dpss(npts, fw, number_of_tapers, auto_spline=True, npts_max=None):
 """ Calculates DPSS also known as Slepian sequences or Slepian tapers. Calculation of the DPSS (Discrete Prolate Spheroidal Sequences) and the correspondent eigenvalues. The (1 - eigenvalue) terms are also calculated. Wraps the ``dpss()`` subroutine from the Fortran library. By default this routine will use spline interpolation if sequences with more than 200.000 samples are requested. .. note:: The tapers are the eigenvectors of the tridiagonal matrix sigma(i, j) [see Slepian(1978) eq 14 and 25]. They are also the eigenvectors of the Toeplitz matrix, eq. 18. :param npts: The number of points in the series. :type npts: int :param fw: The time-bandwidth product (number of Rayleigh bins). :type fw: float :param number_of_tapers: The desired number of tapers. :type number_of_tapers: int :param auto_spline: Whether or not to automatically use spline interpolation for ``npts`` > 200000. :type auto_spline: bool :param npts_max: The number of actual points to calculate the DPSS. If this number is smaller than ``npts``, spline interpolation will be performed, regardless of the value of ``auto_spline``. :type npts_max: None or int :returns: ``(v, lambda, theta)`` with ``v(npts, number_of_tapers)`` the eigenvectors (tapers), ``lambda`` the eigenvalues of the ``v``'s and ``theta`` the 1 - ``lambda`` (energy outside the bandwidth) values. .. rubric:: Example This example demonstrates how to calculate and plot the first five DPSS'. .. plot :: # Same as the code snippet in the docstring, just a bit prettier. import matplotlib.pyplot as plt plt.style.use("ggplot") from mtspec import dpss tapers, lamb, theta = dpss(512, 2.5, 5) for i in range(5):
 plt.plot(tapers[:, i]) plt.xlim(0, 512) plt.ylim(-0.09, 0.09) plt.tight_layout() """

    mt = _MtspecType("float64")

    v = mt.empty((npts, number_of_tapers))
    lamb = mt.empty(number_of_tapers)
    theta = mt.empty(number_of_tapers)

    # Set auto_spline to True.
    if npts_max and npts_max < npts:
        auto_spline = True
    # Always set npts_max.
    else:
        npts_max = 200000

    # Call either the spline routine or the normal routine.
    if auto_spline is True and npts > npts_max:
        mtspeclib.dpss_spline_(
            C.byref(C.c_int(npts_max)), C.byref(C.c_int(npts)),
            C.byref(C.c_double(fw)), C.byref(C.c_int(number_of_tapers)),
            mt.p(v), mt.p(lamb), mt.p(theta))
    else:
        mtspeclib.dpss_(C.byref(C.c_int(npts)), C.byref(C.c_double(fw)),
                        C.byref(C.c_int(number_of_tapers)), mt.p(v),
                        mt.p(lamb), mt.p(theta))

    return (v, lamb, theta)