def as_relational(self, x):
        x = sympify(x)
        if self.right_open:
            right = x < self.end
        else:
            right = x <= self.end
        if self.left_open:
            left = self.start < x
        else:
            left = self.start <= x
        return And(left, right)
Sort low-level factors in increasing 'complexity' order.
dataset/ETHPy150Open sympy/sympy/sympy/sets/sets.py/Interval.as_relational--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/polys/polyutils.py/_sort_factors