def index_along_axis(index, ndim, axis):
    indices = [slice(None)] * ndim
    indices[axis] = index
    return tuple(indices)
Create a slice tuple for indexing into a NumPy array along a
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/utils/insert_along_axis.py/index_along_axis