# Path: zarr/errors.py
# class ArrayIndexError(IndexError):
#     pass
# 
# class NegativeStepError(IndexError):
#     def __init__(self):
#         super().__init__("only slices with step >= 1 are supported")
# 
# def err_too_many_indices(selection, shape):
#     raise IndexError('too many indices for array; expected {}, got {}'
#                      .format(len(shape), len(selection)))
# 
# class VindexInvalidSelectionError(_BaseZarrIndexError):
#     _msg = (
#         "unsupported selection type for vectorized indexing; only "
#         "coordinate selection (tuple of integer arrays) and mask selection "
#         "(single Boolean array) are supported; got {0!r}"
#     )
# 
# class BoundsCheckError(_BaseZarrIndexError):
#     _msg = "index out of bounds for dimension with length {0}"


import collections
import itertools
import math
import numbers
import numpy as np
from zarr.errors import (
    ArrayIndexError,
    NegativeStepError,
    err_too_many_indices,
    VindexInvalidSelectionError,
    BoundsCheckError,
)
                dim_chunk_sel_start = 0
                remainder = (dim_offset - self.start) % self.step
                if remainder:
                    dim_chunk_sel_start += self.step - remainder
                # compute number of previous items, provides offset into output array
                dim_out_offset = ceildiv((dim_offset - self.start), self.step)

            else:
                # selection starts within current chunk
                dim_chunk_sel_start = self.start - dim_offset
                dim_out_offset = 0

            if self.stop > dim_limit:
                # selection ends after current chunk
                dim_chunk_sel_stop = dim_chunk_len

            else:
                # selection ends within current chunk
                dim_chunk_sel_stop = self.stop - dim_offset

            dim_chunk_sel = slice(dim_chunk_sel_start, dim_chunk_sel_stop, self.step)
            dim_chunk_nitems = ceildiv((dim_chunk_sel_stop - dim_chunk_sel_start),
                                       self.step)
            dim_out_sel = slice(dim_out_offset, dim_out_offset + dim_chunk_nitems)

            yield ChunkDimProjection(dim_chunk_ix, dim_chunk_sel, dim_out_sel)


def check_selection_length(selection, shape):
    if len(selection) > len(shape):

# Path: zarr/errors.py
# class ArrayIndexError(IndexError):
#     pass
# 
# class NegativeStepError(IndexError):
#     def __init__(self):
#         super().__init__("only slices with step >= 1 are supported")
# 
# def err_too_many_indices(selection, shape):
#     raise IndexError('too many indices for array; expected {}, got {}'
#                      .format(len(shape), len(selection)))
# 
# class VindexInvalidSelectionError(_BaseZarrIndexError):
#     _msg = (
#         "unsupported selection type for vectorized indexing; only "
#         "coordinate selection (tuple of integer arrays) and mask selection "
#         "(single Boolean array) are supported; got {0!r}"
#     )
# 
# class BoundsCheckError(_BaseZarrIndexError):
#     _msg = "index out of bounds for dimension with length {0}"


# Path: zarr/indexing.py
import collections
import itertools
import math
import numbers
import numpy as np
from zarr.errors import (
    ArrayIndexError,
    NegativeStepError,
    err_too_many_indices,
    VindexInvalidSelectionError,
    BoundsCheckError,
)

                dim_chunk_sel_start = 0
                remainder = (dim_offset - self.start) % self.step
                if remainder:
                    dim_chunk_sel_start += self.step - remainder
                # compute number of previous items, provides offset into output array
                dim_out_offset = ceildiv((dim_offset - self.start), self.step)

            else:
                # selection starts within current chunk
                dim_chunk_sel_start = self.start - dim_offset
                dim_out_offset = 0

            if self.stop > dim_limit:
                # selection ends after current chunk
                dim_chunk_sel_stop = dim_chunk_len

            else:
                # selection ends within current chunk
                dim_chunk_sel_stop = self.stop - dim_offset

            dim_chunk_sel = slice(dim_chunk_sel_start, dim_chunk_sel_stop, self.step)
            dim_chunk_nitems = ceildiv((dim_chunk_sel_stop - dim_chunk_sel_start),
                                       self.step)
            dim_out_sel = slice(dim_out_offset, dim_out_offset + dim_chunk_nitems)

            yield ChunkDimProjection(dim_chunk_ix, dim_chunk_sel, dim_out_sel)


def check_selection_length(selection, shape):
    if len(selection) > len(shape):

        err_too_many_indices(selection, shape)