def _depth_first_select(rectangles):
 (min_area, j) = (None, None)
 for (i, (_, (u, v), (s, t), _, _, _, _)) in enumerate(rectangles):
  area = ((s - u) * (t - v))
  if ((min_area is None) or (area < min_area)):
   (min_area, j) = (area, i)
 return rectangles.pop(j)

def _depth_first_select ( rectangles ) : ( min_area , j ) = ( None , None ) for ( i , ( _ , ( u , v ) , ( s , t ) , _ , _ , _ , _ ) ) in enumerate ( rectangles ) : area = ( ( s - u ) * ( t - v ) ) if ( ( min_area is None ) or ( area < min_area ) ) : ( min_area , j ) = ( area , i ) return rectangles . pop ( j )
find a rectangle of minimum area for bisection .