def SortLines(lines):
    ''' Sort the lines of a block in ascending vertical direction. See comment
    in SortBlocks function.
    '''
    slines = []
    for l in lines:
        y0 = str(int(l["bbox"][1] + 0.99999)).rjust(4,"0")
        slines.append([y0, l])
    slines.sort()
    return [l[1] for l in slines]
 Sort the lines of a block in ascending vertical direction. See comment
    in SortBlocks function.
    
recipes/Python/580626_PDF_Text_Extractiusing_fitz__MuPDF/recipe-580626.py