def check_indices(seq, seq_idx):
    """
    Given a sequence (e.g. list, tuple, ndarray) which is indexed by another,
    check the indices are sensible.

    Parameters
    ----------
    seq : sequence
    seq_idx : sequence of int

    """
    if min(seq_idx) < 0:
        raise IndexError('Found index < 0.')
    if max(seq_idx) > len(seq) - 1:
        raise IndexError('Found index larger than seqence length.')
