def dispatch_event(self, event):
if self.config["<STR_LIT>"]:<EOL><INDENT>self.py3_wrapper.log("<STR_LIT>".format(event))<EOL><DEDENT>event["<STR_LIT:index>"] = event.get("<STR_LIT:index>", "<STR_LIT>")<EOL>instance = event.get("<STR_LIT>", "<STR_LIT>")<EOL>name = event.get("<STR_LIT:name>", "<STR_LIT>")<EOL>if "<STR_LIT:U+0020>" in instance:<EOL><INDENT>instance, index = instance.split("<STR_LIT:U+0020>", <NUM_LIT:1>)<EOL>try:<EOL><INDENT>index = int(index)<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT>event["<STR_LIT:index>"] = index<EOL>event["<STR_LIT>"] = instance<EOL><DEDENT>if self.config["<STR_LIT>"]:<EOL><INDENT>self.py3_wrapper.log(<EOL>'<STR_LIT>'.format(<EOL>"<STR_LIT>".format(name, instance).strip()<EOL>)<EOL>)<EOL><DEDENT>module_name = "<STR_LIT>".format(name, instance).strip()<EOL>default_event = False<EOL>module_info = self.output_modules.get(module_name)<EOL>module = module_info["<STR_LIT>"]<EOL>if module.allow_config_clicks:<EOL><INDENT>button = event.get("<STR_LIT>", <NUM_LIT:0>)<EOL>on_click = self.on_click.get(module_name, {}).get(str(button))<EOL>if on_click:<EOL><INDENT>task = EventClickTask(module_name, event, self, on_click)<EOL>self.py3_wrapper.timeout_queue_add(task)<EOL><DEDENT>elif button == <NUM_LIT:2>:<EOL><INDENT>default_event = True<EOL><DEDENT><DEDENT>task = EventTask(module_name, event, default_event, self)<EOL>self.py3_wrapper.timeout_queue_add(task)<EOL>
Takes an event dict.  Logs the event if needed and cleans up the dict
such as setting the index needed for composits.