code: def clean_indexes(self):
          
          self.sort()
          for index, item in enumerate(self):
              item.index = index + 1
docs: clean_indexes()
  
          Sort subs and reset their index attribute. Should be called after
          destructive operations like split or such.