'Applies the modifications and clears the list'

def apply_modifications(self):

    modifications = self.group_by_name()
    for (name, actions) in sorted(modifications.items()):
        for x in actions:
            x.execute()
