code: def sort_menus(c):
          
          for name in c.items:
              if not c.sorted[name]:
                  c.items[name].sort(key=lambda x: x.weight)
                  c.sorted[name] = True
docs: sort_menus goes through the items and sorts them based on
          their weight