code: def sort_sections(self, order):
          order_lc = [e.lower() for e in order]
          sections = OrderedDict( (k,self.sections[k]) for k in order_lc if k in self.sections)
          sections.update( (k,self.sections[k]) for k in self.sections.keys() if k not in order_lc)
          assert len(self.sections) == len(sections)
          self.sections = sections