def constrain_to_number_events(all_data, minimum_event_count):
    """Remove trials with too few events.

    :param all_data: The output of :func:`make_data_preds`; or data conforming
      to this dictionary style.
    :param minimum_event_count: The minimum number of events we want in a
      trial.
      
    :return: The same format of data, but each "actual occurrance" will have at
      least `minimum_event_count` events.
    """
    return {k:[(g,tps) for g,tps in v if tps.number_data_points >= minimum_event_count]
               for k,v in all_data.items()}