def _check_timedeltalike_freq_compat(self, other):
assert isinstance(self.freq, Tick)  <EOL>own_offset = frequencies.to_offset(self.freq.rule_code)<EOL>base_nanos = delta_to_nanoseconds(own_offset)<EOL>if isinstance(other, (timedelta, np.timedelta64, Tick)):<EOL><INDENT>nanos = delta_to_nanoseconds(other)<EOL><DEDENT>elif isinstance(other, np.ndarray):<EOL><INDENT>assert other.dtype.kind == '<STR_LIT:m>'<EOL>if other.dtype != _TD_DTYPE:<EOL><INDENT>other = other.astype(_TD_DTYPE)<EOL><DEDENT>nanos = other.view('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>nanos = other.asi8<EOL><DEDENT>if np.all(nanos % base_nanos == <NUM_LIT:0>):<EOL><INDENT>delta = nanos // base_nanos<EOL>return delta<EOL><DEDENT>_raise_on_incompatible(self, other)<EOL>
Arithmetic operations with timedelta-like scalars or array `other`
are only valid if `other` is an integer multiple of `self.freq`.
If the operation is valid, find that integer multiple.  Otherwise,
raise because the operation is invalid.

Parameters
----------
other : timedelta, np.timedelta64, Tick,
        ndarray[timedelta64], TimedeltaArray, TimedeltaIndex

Returns
-------
multiple : int or ndarray[int64]

Raises
------
IncompatibleFrequency