def cut_odd_events(end_time, event, save = True):
    """
    
    Cuts sync pulses so that they are even (e.g recording stop before the last
    trial ended)
    :param end_time:  Time in seconds of the end of the last trial
    :param event:  Syncing event to be corrected. It has to be a bunch object 
    (see brainbox.core bunch)
    :return: even syncing for the event (bunch object )
    """
    included_fronts  = tuple([event['times'] <= end_time])
    event['times'] =  event['times'][included_fronts]
    event['polarities'] =  event['polarities'][included_fronts]
    
    return event