<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def publish_event(self, data, suffix=''):
 """ AJAX handler to allow client-side code to publish a server-side event """

        try:
            event_type = data.pop('event_type')
        except KeyError:
            return {'result': 'error', 'message': 'Missing event_type in JSON data'}

        return self.publish_event_from_dict(event_type, data)