@final
def _partial_date_slice(self, reso: Resolution, parsed: datetime):
    '\n        Parameters\n        ----------\n        reso : Resolution\n        parsed : datetime\n\n        Returns\n        -------\n        slice or ndarray[intp]\n        '
    if (not self._can_partial_date_slice(reso)):
        raise ValueError
    (t1, t2) = self._parsed_string_to_bounds(reso, parsed)
    vals = self._data._ndarray
    unbox = self._data._unbox
    if self.is_monotonic_increasing:
        if (len(self) and (((t1 < self[0]) and (t2 < self[0])) or ((t1 > self[(- 1)]) and (t2 > self[(- 1)])))):
            raise KeyError
        left = vals.searchsorted(unbox(t1), side='left')
        right = vals.searchsorted(unbox(t2), side='right')
        return slice(left, right)
    else:
        lhs_mask = (vals >= unbox(t1))
        rhs_mask = (vals <= unbox(t2))
        return (lhs_mask & rhs_mask).nonzero()[0]
Parameters
----------
reso : Resolution
parsed : datetime

Returns
-------
slice or ndarray[intp]
@final
def _partial_date_slice(self, reso: Resolution, parsed: datetime):
    '\n        Parameters\n        ----------\n        reso : Resolution\n        parsed : datetime\n\n        Returns\n        -------\n        slice or ndarray[intp]\n        '
    if (not self._can_partial_date_slice(reso)):
        raise ValueError
    (t1, t2) = self._parsed_string_to_bounds(reso, parsed)
    vals = self._data._ndarray
    unbox = self._data._unbox
    if self.is_monotonic_increasing:
        if (len(self) and (((t1 < self[0]) and (t2 < self[0])) or ((t1 > self[(- 1)]) and (t2 > self[(- 1)])))):
            raise KeyError
        left = vals.searchsorted(unbox(t1), side='left')
        right = vals.searchsorted(unbox(t2), side='right')
        return slice(left, right)
    else:
        lhs_mask = (vals >= unbox(t1))
        rhs_mask = (vals <= unbox(t2))
        return (lhs_mask & rhs_mask).nonzero()[0]