def _calc_num_simulated_obs_meeting_a_condition(simulated_y, condition):
    """
    Calulates the number of simulated observations where `y == 1` and
    `condition == True`.

    Parameters
    ----------
    simulated_y : 1D ndarray of ints in `{0, 1}`.
        Denotes the simulated outcomes.
    condition : 1D ndarray of booleans or ints in `{0, 1}`.
        Denotes the conditions that need to be met in addition to `y == 1`.

    Returns
    -------
    num : scalar.
        The number observations with `simulated_y == 1 and condition == True`.
    """
    if simulated_y.shape[0] != condition.shape[0]:
        msg = "simulated_y.shape[0] MUST EQUAL condition.shape[0]"
        raise ValueError(msg)
    return simulated_y.T.dot(condition)