def event(self, cuuid, host, euuid, event_data, timestamp, priority):
<EOL>response = None<EOL>if host in self.encrypted_hosts:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>client_key = self.registry[cuuid]["<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>client_key = None<EOL><DEDENT>port = host[<NUM_LIT:1>]<EOL>host = host[<NUM_LIT:0>]<EOL>if not self.is_registered(cuuid, host):<EOL><INDENT>logger.warning("<STR_LIT>" % cuuid)<EOL>response = serialize_data({"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT:data>": "<STR_LIT>"},<EOL>self.compression,<EOL>self.encryption, client_key)<EOL>return response<EOL><DEDENT>if euuid in self.event_uuids:<EOL><INDENT>logger.warning("<STR_LIT>" % (cuuid,<EOL>euuid))<EOL>return response<EOL><DEDENT>self.event_uuids[euuid] = <NUM_LIT:0><EOL>logger.debug("<STR_LIT>"<EOL>"<STR_LIT:%s>" % (cuuid, euuid, str(self.event_uuids)))<EOL>logger.debug("<STR_LIT>" % (cuuid, euuid))<EOL>logger.debug("<STR_LIT>" % (cuuid,<EOL>euuid,<EOL>pformat(event_data)))<EOL>if self.middleware.event_legal(cuuid, euuid, event_data):<EOL><INDENT>logger.debug("<STR_LIT>"<EOL>"<STR_LIT>" % (cuuid, euuid))<EOL>response = serialize_data({"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": euuid,<EOL>"<STR_LIT>": priority},<EOL>self.compression,<EOL>self.encryption, client_key)<EOL>thread = threading.Thread(target=self.middleware.event_execute,<EOL>args=(cuuid, euuid, event_data)<EOL>)<EOL>thread.start()<EOL><DEDENT>else:<EOL><INDENT>logger.debug("<STR_LIT>"<EOL>"<STR_LIT>" % (cuuid, euuid))<EOL>response = serialize_data({"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": euuid,<EOL>"<STR_LIT>": priority},<EOL>self.compression,<EOL>self.encryption, client_key)<EOL><DEDENT>self.listener.call_later(self.timeout, self.retransmit,<EOL>{"<STR_LIT>": euuid,<EOL>"<STR_LIT>": response, "<STR_LIT>": cuuid})<EOL>return response<EOL>
This function will process event packets and send them to legal
        checks.

        Args:
          cuuid (string): The client uuid that the event came from.
          host (tuple): The (address, port) tuple of the client.
          euuid (string): The event uuid of the specific event.
          event_data (any): The event data that we will be sending to the
            middleware to be judged and executed.
          timestamp (string): The client provided timestamp of when the event
            was created.
          priority (string): The priority of the event. This is normally set to
            either "normal" or "high". If an event was sent with a high
            priority, then the client will not wait for a response from the
            server before executing the event locally.

        Returns:
          A LEGAL/ILLEGAL response to be sent to the client.