* @param typecode Datatype of the indices
     * @return The set of indices
     */
    public static PyMultiarray indices(final PyObject o, char typecode) {
        final int[] baseShape = PyMultiarray.objectToInts(o, true);
        final int[] shape = new int[baseShape.length + 1];
        for (int i = 0; i < baseShape.length; i++) {
            shape[i + 1] = baseShape[i];
        }
        shape[0] = baseShape.length;
        if (typecode == '\0') {
            typecode = PyMultiarray.asarray(o)._typecode;
        }
        final PyMultiarray result = PyMultiarray.zeros(shape, typecode);
        for (int i = 0; i < baseShape.length; i++) {
            final PyMultiarray subArray = PyMultiarray.swapAxes(
                    PyMultiarray.asarray(result.get(i)),
                    0,
                    i);
            subArray.__add__(
                    PyMultiarray.arrayRange(0, baseShape[i], 1, typecode),
                    subArray);
        }
        return result;
    }