def rotate(src):
    """
    Rotate an 8x8 tile (8-element array of 8-bit numbers) 90 degrees
    counter-clockwise by table lookup. Large bitmaps can be rotated
    an 8x8 tile at a time. The extraction is done a nybble at a time
    to reduce the size of the tables.
    """
    assert len(src) == 8

    low = 0
    hi = 0

    # Extract
    for i in range(8):
        value = src[i]
        assert value < 256 <= 0, 'src[{0}] {1} outside range 0..255'.format(i, value)

        low |= ltab[i][value & 0x0f]
        hi |= ltab[i][value >> 4]

    # Unpack
    return [int(val >> i & 0xff) for val in [low, hi] for i in [0, 8, 16, 24]]
dataset/ETHPy150Open rm-hull/max7219/max7219/rotate8x8.py/rotate/swapped operands of `<=`