def METHOD_NAME(spec, state, not_slashable_set=set()):
    # Slashed count to ensure that enough validators are slashed to induce maximum penalties
    slashed_count = min(
        (len(state.validators) // get_slashing_multiplier(spec)) + 1,
        # Can't slash more than validator count!
        len(state.validators)
    )
    out_epoch = spec.get_current_epoch(state) + (spec.EPOCHS_PER_SLASHINGS_VECTOR // 2)
    eligible_indices = set(range(slashed_count))
    slashed_indices = eligible_indices.difference(not_slashable_set)
    slash_validators(spec, state, sorted(slashed_indices), [out_epoch] * slashed_count)
    total_balance = spec.get_total_active_balance(state)
    total_penalties = sum(state.slashings)
    assert total_balance // get_slashing_multiplier(spec) <= total_penalties
    return slashed_indices