def finalize_structure(self):
self.group_list.append(self.current_group)<EOL>group_set = get_unique_groups(self.group_list)<EOL>for item in self.group_list:<EOL><INDENT>self.group_type_list.append(group_set.index(item))<EOL><DEDENT>self.group_list = [x.convert_to_dict() for x in group_set]<EOL>
Any functions needed to cleanup the structure.