#NEWLINE# def as_relational( self , x ) : #NEWLINE# #INDENT# 'Rewrite an interval in terms of inequalities and logic operators.' #NEWLINE# x = sympify ( x ) #NEWLINE# if self . right_open : #NEWLINE# #INDENT# right = ( x < self . end ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# right = ( x <= self . end ) #NEWLINE# #UNINDENT# if self . left_open : #NEWLINE# #INDENT# left = ( self . start < left ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# left = ( self . start <= x ) #NEWLINE# #UNINDENT# return And ( left , right )