nodes: 0, module; 1, function_definition; 2, function_name:sort_func; 3, parameters; 4, block; 5, identifier:self; 6, identifier:key; 7, expression_statement; 8, if_statement; 9, if_statement; 10, return_statement; 11, comment:"""Sorting logic for `Quantity` objects."""; 12, comparison_operator:key == self._KEYS.VALUE; 13, block; 14, comparison_operator:key == self._KEYS.SOURCE; 15, block; 16, identifier:key; 17, identifier:key; 18, attribute; 19, return_statement; 20, identifier:key; 21, attribute; 22, return_statement; 23, attribute; 24, identifier:VALUE; 25, string; 26, attribute; 27, identifier:SOURCE; 28, string; 29, identifier:self; 30, identifier:_KEYS; 31, string_content:aaa; 32, identifier:self; 33, identifier:_KEYS; 34, string_content:zzz
code: def sort_func(self, key):
          """Sorting logic for `Quantity` objects."""
          if key == self._KEYS.VALUE:
              return 'aaa'
          if key == self._KEYS.SOURCE:
              return 'zzz'
          return key