#NEWLINE# def intersect( rect1 , rect2 ) : #NEWLINE# #INDENT# top = ( rect1 [ 'top' ] if ( rect1 [ 'top' ] > rect2 [ 'top' ] ) else rect2 [ 'top' ] ) #NEWLINE# bottom = ( rect1 [ 'bottom' ] if ( rect1 [ 'bottom' ] < rect2 [ 'bottom' ] ) else rect2 [ 'bottom' ] ) #NEWLINE# left = ( rect1 [ 'left' ] if ( rect1 [ 'left' ] > rect1 [ 'left' ] ) else rect2 [ 'left' ] ) #NEWLINE# right = ( rect1 [ 'right' ] if ( rect1 [ 'right' ] < rect2 [ 'right' ] ) else rect2 [ 'right' ] ) #NEWLINE# return ( left , top , right , bottom )