code: def preferred_ordinal(cls, attr_name):
          attr_name = cls.map(attr_name)
          if attr_name in cls.preferred_order:
              ordinal = cls.preferred_order.index(attr_name)
          else:
              ordinal = len(cls.preferred_order)
          return (ordinal, attr_name)