def check_bounds(wvd, shape):
    for (fid, wv) in wvd.items():
        for (i, w) in wv.items():
            for (x, y, t, s) in w:
                if ((x < 0) or (x >= shape[1]) or (y < 0) or (y >= shape[0])):
                    print('out of bounds')
                    pdb.set_trace()
                if (not (w.x.flags.contiguous and w.y.flags.contiguous)):
                    print('not contiguous')
                    pdb.set_trace()
def check_bounds(wvd, shape):
    for (fid, wv) in wvd.items():
        for (i, w) in wv.items():
            for (x, y, t, s) in w:
                if ((x < 0) or (x >= shape[1]) or (y < 0) or (y >= shape[0])):
                    print('out of bounds')
                    pdb.set_trace()
                if (not (w.x.flags.contiguous and w.y.flags.contiguous)):
                    print('not contiguous')
                    pdb.set_trace()