def _index_n(x, axes, index_spec):
    """
    Form indexing tuple for NumPy arrays.

    Parameters
    ----------
    x : :py:class:`~numpy.ndarray`
        Array to index.
    axes : list(int)
        Dimensions along which to apply `index_spec`.
    index_spec : list(:py:class:`slice`)
        Index/slice to use.

    Returns
    -------
    indexer : tuple
        Indexing tuple.
    """
    assert len(axes) == len(index_spec)
    idx = [slice(None)] * x.ndim
    for i, ax in enumerate(axes):
        idx[ax] = index_spec[i]

    indexer = tuple(idx)
    return indexer