def print_chunklayer(blocks, data, add, yoffset):
    blocks = list(blocks[yoffset*256:(yoffset+1)*256])
    data = array_4bit_to_byte(data[yoffset*128:(yoffset+1)*128])
    if add is not None:
        add = array_4bit_to_byte(add[yoffset*128:(yoffset+1)*128])
        for i,v in enumerate(add):
            blocks[i] += 256*v
    
    assert len(blocks) == 256
    assert len(data) == 256
    
    for row in grouper(zip(blocks,data), 16):
        print (" ".join((block % "%4d:%-2d") for block in row))
dataset/ETHPy150Open twoolie/NBT/examples/anvil_blockdata.py/print_chunklayer/swapped operands of `%`