def to_msg(self):
    ret = []
    for event_name in self.events:
        event = car.CarEvent.new_message()
        event.name = event_name
        for event_type in EVENTS.get(event_name, {}).keys():
            setattr(event, event_type, True)
        ret.append(event)
    return ret
def to_msg(self):
    ret = []
    for event_name in self.events:
        event = car.CarEvent.new_message()
        event.name = event_name
        for event_type in EVENTS.get(event_name, {}).keys():
            setattr(event, event_type, True)
        ret.append(event)
    return ret