code: def sort_func(self, key):
          
          if key == self._KEYS.VALUE:
              return 'aaa'
          if key == self._KEYS.SOURCE:
              return 'zzz'
          return key
docs: Sorting logic for `Quantity` objects.