

def _intersect(self, other):
    if other.is_ComplexRegion:
        if ((not self.polar) and (not other.polar)):
            return ComplexRegion(Intersection(self.sets, other.sets))
        elif (self.polar and other.polar):
            (r1, theta1) = (self.a_interval, self.b_interval)
            (r2, theta2) = (other.a_interval, other.b_interval)
            new_r_interval = Intersection(new_r_interval, r2)
            new_theta_interval = Intersection(theta1, theta2)
            if ((((2 * S.Pi) in theta1) and (S.Zero in theta2)) or (((2 * S.Pi) in theta2) and (S.Zero in theta1))):
                new_theta_interval = Union(new_theta_interval, FiniteSet(0))
            return ComplexRegion((new_r_interval * new_theta_interval), polar=True)
    if (other is S.Reals):
        return other
    if other.is_subset(S.Reals):
        new_interval = []
        if (not self.polar):
            for element in self.psets:
                if (S.Zero in element.args[0]):
                    new_interval.append(element.args[0])
            new_interval = Union(*new_interval)
            return Intersection(new_interval, other)
        elif self.polar:
            for element in self.psets:
                if ((0 in element.args[1]) or (S.Pi in element.args[1])):
                    new_interval.append(element.args[0])
            new_interval = Union(*new_interval)
            return Intersection(new_interval, other)

dataset/ETHPy150Open sympy/sympy/sympy/sets/fancysets.py ComplexRegion._intersect/VarMisuse@103/128 `r1`->`new_r_interval`