def _reverse_intervals(intervals):
 return [((b, a), indices, f) for ((a, b), indices, f) in reversed(intervals)]

def _reverse_intervals ( intervals ) : return [ ( ( b , a ) , indices , f ) for ( ( a , b ) , indices , f ) in reversed ( intervals ) ]
reverse intervals for traversal from right to left and from top to bottom .