def shape_and_validate(y, log_pred_prob):
    """Validate shapes and types of predictive distribution against data and
    return the shape information.

    Parameters
    ----------
    y : ndarray of type int or bool, shape (n_samples,)
        True labels for each classication data point.
    log_pred_prob : ndarray, shape (n_samples, n_labels)
        Array of shape ``(len(y), n_labels)``. Each row corresponds to a
        categorical distribution with *normalized* probabilities in log scale.
        Therefore, the number of columns must be at least 1.

    Returns
    -------
    n_samples : int
        Number of data points (length of `y`)
    n_labels : int
        The number of possible labels in `y`. Inferred from size of
        `log_pred_prob` and *not* from `y`.

    Notes
    -----
    This does *not* check normalization.
    """
    n_samples, n_labels = log_pred_prob.shape
    assert n_samples >= 1  # Otherwise min and max confused
    assert n_labels >= 1  # Otherwise makes no sense
    assert y.shape == (n_samples,) and y.dtype.kind in ("b", "i")
    assert 0 <= y.min() and y.max() < n_labels
    return n_samples, n_labels