def ensure_num_chosen_alts_equals_num_obs(obs_id_col, choice_col, df):
    """
    Checks that the total number of recorded choices equals the total number of
    observations. If this is not the case, raise helpful ValueError messages.

    Parameters
    ----------
    obs_id_col : str.
        Denotes the column in `df` that contains the observation ID values for
        each row.
    choice_col : str.
        Denotes the column in `long_data` that contains a one if the
        alternative pertaining to the given row was the observed outcome for
        the observation pertaining to the given row and a zero otherwise.
    df : pandas dataframe.
        The dataframe whose choices and observations will be checked.

    Returns
    -------
    None.
    """
    num_obs = df[obs_id_col].unique().shape[0]
    num_choices = df[choice_col].sum()
    if num_choices < num_obs:
        msg = 'One or more observations have not chosen one '
        msg_2 = 'of the alternatives available to him/her'
        raise ValueError(msg + msg_2)
    if num_choices > num_obs:
        msg = 'One or more observations has chosen multiple alternatives'
        raise ValueError(msg)
    return None
