def METHOD_NAME(
    ndim: int,
    indices: IndicesType,
) -> NormalisedIndicesType:
    """Replace Ellipsis and complete indices to match ndim"""
    if not isinstance(indices, tuple):
        indices = (indices,)
    nb_ellipsis = indices.count(Ellipsis)
    if nb_ellipsis > 1:
        raise IndexError("an index can only have a single ellipsis ('...')")
    if nb_ellipsis == 1:
        ellipsis_index = indices.index(Ellipsis)
        return (
            indices[:ellipsis_index]
            + (slice(None),) * max(0, (ndim - len(indices) + 1))
            + indices[ellipsis_index + 1 :]
        )
    if len(indices) > ndim:
        raise IndexError(
            f"too many indices ({len(indices)}) for the number of dimensions ({ndim})"
        )
    return indices + (slice(None),) * (ndim - len(indices))