def _maybe_convert_timedelta(self, other):
if isinstance(<EOL>other, (timedelta, np.timedelta64, Tick, np.ndarray)):<EOL><INDENT>offset = frequencies.to_offset(self.freq.rule_code)<EOL>if isinstance(offset, Tick):<EOL><INDENT>delta = self._data._check_timedeltalike_freq_compat(other)<EOL>return delta<EOL><DEDENT><DEDENT>elif isinstance(other, DateOffset):<EOL><INDENT>freqstr = other.rule_code<EOL>base = libfrequencies.get_base_alias(freqstr)<EOL>if base == self.freq.rule_code:<EOL><INDENT>return other.n<EOL><DEDENT>msg = DIFFERENT_FREQ.format(cls=type(self).__name__,<EOL>own_freq=self.freqstr,<EOL>other_freq=other.freqstr)<EOL>raise IncompatibleFrequency(msg)<EOL><DEDENT>elif is_integer(other):<EOL><INDENT>return other<EOL><DEDENT>msg = DIFFERENT_FREQ.format(cls=type(self).__name__,<EOL>own_freq=self.freqstr,<EOL>other_freq=None)<EOL>raise IncompatibleFrequency(msg)<EOL>
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.