def render_oblique_chunk((chunk_file, map_size, render_options)):
    chunk = nbt.NBTFile(chunk_file, 'rb')
    array_offset_X = (abs(map_size['x_min']) + chunk['Level']['xPos'].value) * Level.chunk_size_X
    array_offset_Z = (abs(map_size['z_min']) + chunk['Level']['zPos'].value) * Level.chunk_size_Z

    try:
        blocks = numpy.fromstring(chunk['Level']['Blocks'].value, dtype=numpy.uint8).reshape(Level.chunk_size_X, Level.chunk_size_Z, Level.chunk_size_Y)
        new_chunk_pixels = image_array[array_offset_Z : array_offset_Z + Level.chunk_size_Z * 2 + Level.chunk_size_Y,
            array_offset_X : array_offset_X + Level.chunk_size_X]

        for y in range(Level.chunk_size_Y):
            colors = Level.base_block_colors[blocks[...,y]].reshape(Level.chunk_size_X, Level.chunk_size_Z, Level.color_depth)
            shaded_colors = Level.base_block_colors[blocks[...,y]].reshape(Level.chunk_size_X, Level.chunk_size_Z, Level.color_depth)
            for z,x in itertools.product(*map(xrange, [Level.chunk_size_X, Level.chunk_size_Z])):
                try:
                    new_chunk_pixels[(Level.chunk_size_Y - y) + z, x] = overlay_pixel(colors[x, z], new_chunk_pixels[(Level.chunk_size_Y - y) + z, x])
                    new_chunk_pixels[(y - Level.chunk_size_Y) + z + 1, x] = overlay_pixel(shaded_colors[x, z], new_chunk_pixels[(Level.chunk_size_Y - y) + z + 1, x])
                except IndexError:
                    pass
        image_array[array_offset_Z : array_offset_Z + Level.chunk_size_Z * 2 + Level.chunk_size_Y,
            array_offset_X : array_offset_X + Level.chunk_size_X] = new_chunk_pixels
    except IndexError, err:
        print 'Failed chunk: %s' % err
dataset/ETHPy150Open aheadley/pynemap/pynemap.py/render_oblique_chunk/swapped operands of `-`