def reorder_lines(lines, tol=TOLERANCE):
reordered_lines = []<EOL>for line in lines:<EOL><INDENT>reordered_lines += [<EOL>(<EOL>int(round(line.y0 / tol) * tol),<EOL>int(round(line.x0 / tol) * tol),<EOL>int(round(line.y1 / tol) * tol),<EOL>int(round(line.x1 / tol) * tol),<EOL>)<EOL>]<EOL><DEDENT>return reordered_lines<EOL>
Changes the line coordinates to be given as (top, left, bottom, right)
:param lines: list of lines coordinates
:return: reordered list of lines coordinates