def aggregate_message(self, message):
<EOL>main = message["<STR_LIT:data>"][<NUM_LIT:0>]<EOL>finalizers = ["<STR_LIT>"]<EOL>for k,v in self.fields.items():<EOL><INDENT>if v.get("<STR_LIT>") not in finalizers:<EOL><INDENT>main[k] = self.aggregate_field(k, message["<STR_LIT:data>"])<EOL><DEDENT><DEDENT>for k,v in self.fields.items():<EOL><INDENT>if v.get("<STR_LIT>") in finalizers:<EOL><INDENT>main[k] = self.aggregate_field(k, message["<STR_LIT:data>"])<EOL><DEDENT><DEDENT>main["<STR_LIT>"] = len(message["<STR_LIT:data>"])<EOL>message["<STR_LIT:data>"] = [main]<EOL>
Takesa vaping message with multiple items
in it's data property and aggregates that data