def xy_reading_order(e1, e2):
b1 = e1.bbox<EOL>b2 = e2.bbox<EOL>if round(b1[x0]) == round(b2[x0]):<EOL><INDENT>return float_cmp(b1[y0], b2[y0])<EOL><DEDENT>return float_cmp(b1[x0], b2[x0])<EOL>
A comparator to sort bboxes from left to right, top to bottom