def _intersection(self, other: Index, sort=False) -> Index:
    '\n        intersection specialized to the case with matching dtypes and both non-empty.\n        '
    other = cast('DatetimeTimedeltaMixin', other)
    if self._can_range_setop(other):
        return self._range_intersect(other, sort=sort)
    if (not self._can_fast_intersect(other)):
        result = Index._intersection(self, other, sort=sort)
        result = self._wrap_setop_result(other, result)
        return result._with_freq(None)._with_freq('infer')
    else:
        return self._fast_intersect(other, sort)
intersection specialized to the case with matching dtypes and both non-empty.
def _intersection(self, other: Index, sort=False) -> Index:
    '\n        \n        '
    other = cast('DatetimeTimedeltaMixin', other)
    if self._can_range_setop(other):
        return self._range_intersect(other, sort=sort)
    if (not self._can_fast_intersect(other)):
        result = Index._intersection(self, other, sort=sort)
        result = self._wrap_setop_result(other, result)
        return result._with_freq(None)._with_freq('infer')
    else:
        return self._fast_intersect(other, sort)