<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tseries_between(self, tstart=None, tend=None):
 """Return time series data between requested times. Args: tstart (float):
 starting time. Set to None to start at the beginning of available data. tend (float):
 ending time. Set to None to stop at the end of available data. Returns: :class:`pandas.DataFrame`: slice of :attr:`tseries`. """

        if self.tseries is None:
            return None

        ndat = self.tseries.shape[0]

        if tstart is None:
            istart = 0
        else:
            igm = 0
            igp = ndat - 1
            while igp - igm > 1:
                istart = igm + (igp - igm) // 2
                if self.tseries.iloc[istart]['t'] >= tstart:
                    igp = istart
                else:
                    igm = istart
            istart = igp

        if tend is None:
            iend = None
        else:
            igm = 0
            igp = ndat - 1
            while igp - igm > 1:
                iend = igm + (igp - igm) // 2
                if self.tseries.iloc[iend]['t'] > tend:
                    igp = iend
                else:
                    igm = iend
            iend = igm + 1

        return self.tseries.iloc[istart:iend]