def _intersect(self, other):
        # We only know how to intersect with other intervals
        if not other.is_Interval:
            return None

        # handle (-oo, oo)
        infty = S.NegativeInfinity, S.Infinity
        if self == Interval(*infty):
            l, r = self.left, self.right
            if l.is_real or l in infty or r.is_real or r in infty:
                return other

        # We can't intersect [0,3] with [x,6] -- we don't know if x>0 or x<0
        if not self._is_comparable(other):
            return None

        empty = False

        if self.start <= other.end and other.start <= self.end:
            # Get topology right.
            if self.start < other.start:
                start = other.start
                left_open = other.left_open
            elif self.start > other.start:
                start = self.start
                left_open = self.left_open
            else:
                start = self.start
                left_open = self.left_open or other.left_open

            if self.end < other.end:
                end = self.end
                right_open = self.right_open
            elif self.end > other.end:
                end = other.end
                right_open = other.right_open
            else:
                end = self.end
                right_open = self.right_open or other.right_open

            if end - start == 0 and (left_open or right_open):
                empty = True
        else:
            empty = True

        if empty:
            return S.EmptySet

        return Interval(start, end, left_open, right_open)
This routine sorts the eigenvalues and eigenvectors delivered by ``eig``.
dataset/ETHPy150Open sympy/sympy/sympy/sets/sets.py/Interval._intersect--crossover with--dataset/ETHPy150Open fredrik-johansson/mpmath/mpmath/matrices/eigen.py/eig_sort