def _maybe_convert_timedelta(self, other):
    '\n        Convert timedelta-like input to an integer multiple of self.freq\n\n        Parameters\n        ----------\n        other : timedelta, np.timedelta64, DateOffset, int, np.ndarray\n\n        Returns\n        -------\n        converted : int, np.ndarray[int64]\n\n        Raises\n        ------\n        IncompatibleFrequency : if the input cannot be written as a multiple\n            of self.freq.  Note IncompatibleFrequency subclasses ValueError.\n        '
    if isinstance(other, (timedelta, np.timedelta64, Tick, np.ndarray)):
        if isinstance(self.freq, Tick):
            delta = self._data._check_timedeltalike_freq_compat(other)
            return delta
    elif isinstance(other, BaseOffset):
        if (other.base == self.freq.base):
            return other.n
        raise raise_on_incompatible(self, other)
    elif is_integer(other):
        return other
    raise raise_on_incompatible(self, None)
Convert timedelta-like input to an integer multiple of self.freq

Parameters
----------
other : timedelta, np.timedelta64, DateOffset, int, np.ndarray

Returns
-------
converted : int, np.ndarray[int64]

Raises
------
IncompatibleFrequency : if the input cannot be written as a multiple
    of self.freq.  Note IncompatibleFrequency subclasses ValueError.
def _maybe_convert_timedelta(self, other):
    '\n        Convert timedelta-like input to an integer multiple of self.freq\n\n        Parameters\n        ----------\n        other : timedelta, np.timedelta64, DateOffset, int, np.ndarray\n\n        Returns\n        -------\n        converted : int, np.ndarray[int64]\n\n        Raises\n        ------\n        IncompatibleFrequency : if the input cannot be written as a multiple\n            of self.freq.  Note IncompatibleFrequency subclasses ValueError.\n        '
    if isinstance(other, (timedelta, np.timedelta64, Tick, np.ndarray)):
        if isinstance(self.freq, Tick):
            delta = self._data._check_timedeltalike_freq_compat(other)
            return delta
    elif isinstance(other, BaseOffset):
        if (other.base == self.freq.base):
            return other.n
        raise raise_on_incompatible(self, other)
    elif is_integer(other):
        return other
    raise raise_on_incompatible(self, None)