def METHOD_NAME(dimblock, dimcube, cubedist, cubeoffset):
    n = len(dimblock)
    dimcube = getlist(dimcube, n=n)
    cubedist = getlist(cubedist, n=n)
    cubeoffset = getlist(cubeoffset, n=n)
    indices = numpy.indices(dimblock)
    indices = numpy.rollaxis(indices, 0, len(dimblock) + 1)
    out = numpy.ones(dimblock, dtype=bool)
    for i in range(len(dimblock)):
        out = numpy.bitwise_and(out, (indices[..., i] + cubeoffset[i]) % cubedist[i] < dimcube[i])
    out = out.astype(numpy.uint8)
    return out