def column_order(b1, b2):
(top, left, bottom) = (<NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:3>)<EOL>if round(b1[top]) == round(b2[top]) or round(b1[bottom]) == round(b2[bottom]):<EOL><INDENT>return float_cmp(b1[left], b2[left])<EOL><DEDENT>return float_cmp(b1[top], b2[top])<EOL>
A comparator that sorts bboxes first by "columns", where a column is made
up of all bboxes that overlap, then by vertical position in each column.

b1 = [b1.type, b1.top, b1.left, b1.bottom, b1.right]
b2 = [b2.type, b2.top, b2.left, b2.bottom, b2.right]