docs: def reorder_lines(lines, tol=TOLERANCE):
      """
      Changes the line coordinates to be given as (top, left, bottom, right)
      :param lines: list of lines coordinates
      :return: reordered list of lines coordinates
      """
      reordered_lines = []
      for line in lines:
          # we divide by tol and multiply by tol to truncate numbers, stairs function
          reordered_lines += [
              (
                  int(round(line.y0 / tol) * tol),
                  int(round(line.x0 / tol) * tol),
                  int(round(line.y1 / tol) * tol),
                  int(round(line.x1 / tol) * tol),
              )
          ]
      return reordered_lines