def add_finder_patterns(matrix, is_micro):
    """    Adds the finder pattern(s) with the separators to the matrix.

    QR Codes get three finder patterns, Micro QR Codes have just one finder
    pattern.

    ISO/IEC 18004:2015(E) -- 6.3.3 Finder pattern (page 16)
    ISO/IEC 18004:2015(E) -- 6.3.4 Separator (page 17)

    :param matrix: The matrix.
    :param bool is_micro: Indicates if the matrix represents a Micro QR Code.
    """
    pattern = (0, 0, 0, 0, 0, 0, 0, 0, 0), (0, 1, 1, 1, 1, 1, 1, 1, 0), (0,
        1, 0, 0, 0, 0, 0, 1, 0), (0, 1, 0, 1, 1, 1, 0, 1, 0), (0, 1, 0, 1, 
        1, 1, 0, 1, 0), (0, 1, 0, 1, 1, 1, 0, 1, 0), (0, 1, 0, 0, 0, 0, 0, 1, 0
        ), (0, 1, 1, 1, 1, 1, 1, 1, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0)
    corners = (0, 0), (0, len(matrix) - 8), (-8, 0)
    if is_micro:
        corners = (0, 0),
    finder_range = range(8)
    for i, j in corners:
        offset = 1 if i == 0 else 0
        sepoffset = 0 if j != 0 else 1
        for r in finder_range:
            matrix[i + r][j:j + 8] = pattern[offset + r][sepoffset:
                sepoffset + 8]
