def add_timing_pattern(matrix, is_micro):
    """    Adds the (horizontal and vertical) timinig pattern to the provided `matrix`.

    ISO/IEC 18004:2015(E) -- 6.3.5 Timing pattern (page 17)

    :param matrix: Matrix to add the timing pattern into.
    :param bool is_micro: Indicates if the timing pattern for a Micro QR Code
        should be added.
    """
    bit = 1
    y, stop = (0, len(matrix)) if is_micro else (6, len(matrix) - 8)
    for x in range(8, stop):
        matrix[x][y] = bit
        matrix[y][x] = bit
        bit ^= 1
