@apply_index_wraps<EOL><INDENT>def apply_index(self, i):<DEDENT>
if type(self) is not DateOffset:<EOL><INDENT>raise NotImplementedError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>name=self.__class__.__name__))<EOL><DEDENT>kwds = self.kwds<EOL>relativedelta_fast = {'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>'}<EOL>if (self._use_relativedelta and<EOL>set(kwds).issubset(relativedelta_fast)):<EOL><INDENT>months = ((kwds.get('<STR_LIT>', <NUM_LIT:0>) * <NUM_LIT:12> +<EOL>kwds.get('<STR_LIT>', <NUM_LIT:0>)) * self.n)<EOL>if months:<EOL><INDENT>shifted = liboffsets.shift_months(i.asi8, months)<EOL>i = type(i)(shifted, freq=i.freq, dtype=i.dtype)<EOL><DEDENT>weeks = (kwds.get('<STR_LIT>', <NUM_LIT:0>)) * self.n<EOL>if weeks:<EOL><INDENT>asper = i.to_period('<STR_LIT>')<EOL>if not isinstance(asper._data, np.ndarray):<EOL><INDENT>asper = asper._data<EOL><DEDENT>shifted = asper._time_shift(weeks)<EOL>i = shifted.to_timestamp() + i.to_perioddelta('<STR_LIT>')<EOL><DEDENT>timedelta_kwds = {k: v for k, v in kwds.items()<EOL>if k in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>']}<EOL>if timedelta_kwds:<EOL><INDENT>delta = Timedelta(**timedelta_kwds)<EOL>i = i + (self.n * delta)<EOL><DEDENT>return i<EOL><DEDENT>elif not self._use_relativedelta and hasattr(self, '<STR_LIT>'):<EOL><INDENT>return i + (self._offset * self.n)<EOL><DEDENT>else:<EOL><INDENT>kwd = set(kwds) - relativedelta_fast<EOL>raise NotImplementedError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(kwd=kwd))<EOL><DEDENT>
Vectorized apply of DateOffset to DatetimeIndex,
raises NotImplentedError for offsets without a
vectorized implementation.

Parameters
----------
i : DatetimeIndex

Returns
-------
y : DatetimeIndex