def _slice_indices(slicer, arr_size, arr_shape):
    '\n    Return an index array based on a slice or slice tuple and the array size and shape.\n\n    Parameters\n    ----------\n    slicer : slice or tuple containing slices\n        Slice object to slice array\n    arr_size : int\n        Size of output array\n    arr_shape : tuple\n        Tuple of output array shape\n\n    Returns\n    -------\n    array\n        Returns the sliced indices.\n    '
    if isinstance(slicer, slice):
        (start, stop, step) = (slicer.start, slicer.stop, slicer.step)
        if (start is None):
            start = 0
        if (stop is None):
            stop = arr_size
        if (step is None):
            step = 1
        return np.arange(start, stop, step, dtype=INT_DTYPE).reshape(arr_shape)
    else:
        return np.arange(arr_size, dtype=INT_DTYPE).reshape(arr_shape)[slicer]
Return an index array based on a slice or slice tuple and the array size and shape.

Parameters
----------
slicer : slice or tuple containing slices
    Slice object to slice array
arr_size : int
    Size of output array
arr_shape : tuple
    Tuple of output array shape

Returns
-------
array
    Returns the sliced indices.
def _slice_indices(slicer, arr_size, arr_shape):
    '\n    Return an index array based on a slice or slice tuple and the array size and shape.\n\n    Parameters\n    ----------\n    slicer : slice or tuple containing slices\n        Slice object to slice array\n    arr_size : int\n        Size of output array\n    arr_shape : tuple\n        Tuple of output array shape\n\n    Returns\n    -------\n    array\n        Returns the sliced indices.\n    '
    if isinstance(slicer, slice):
        (start, stop, step) = (slicer.start, slicer.stop, slicer.step)
        if (start is None):
            start = 0
        if (stop is None):
            stop = arr_size
        if (step is None):
            step = 1
        return np.arange(start, stop, step, dtype=INT_DTYPE).reshape(arr_shape)
    else:
        return np.arange(arr_size, dtype=INT_DTYPE).reshape(arr_shape)[slicer]