'Returns the intersection of \'self\' and \'other\'.
Here other can be an instance of FiniteSet or AccumulationBounds.
Examples
>>> from sympy import AccumBounds, FiniteSet
>>> AccumBounds(1, 3).intersection(AccumBounds(2, 4))
<2, 3>
>>> AccumBounds(1, 3).intersection(AccumBounds(4, 6))
EmptySet()
>>> AccumBounds(1, 4).intersection(FiniteSet(1, 2, 5))
{1, 2}'

def intersection(self, other):

    if (not isinstance(other, (AccumBounds, FiniteSet))):
        raise TypeError('Input    must    be    AccumulationBounds    or    FiniteSet    object')
    if isinstance(other, FiniteSet):
        fin_set = S.EmptySet
        for i in other:
            if (i in self):
                fin_set = (fin_set + FiniteSet(i))
        return fin_set
    if ((self.max < other.min) or (self.min > other.max)):
        return S.EmptySet
    if (self.min <= other.min):
        if (self.max <= other.max):
            return AccumBounds(other.min, self.max)
        if (self.max > other.max):
            return other
    if (other.min <= self.min):
        if (other.max < self.max):
            return AccumBounds(self.min, other.max)
        if (other.max > self.max):
            return self
