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, if_statement; 11, return_statement; 12, comment:"""Logic for sorting keys in a `Spectrum` relative to one another."""; 13, comparison_operator:key == self._KEYS.TIME; 14, block; 15, comparison_operator:key == self._KEYS.DATA; 16, block; 17, comparison_operator:key == self._KEYS.SOURCE; 18, block; 19, identifier:key; 20, identifier:key; 21, attribute; 22, return_statement; 23, identifier:key; 24, attribute; 25, return_statement; 26, identifier:key; 27, attribute; 28, return_statement; 29, attribute; 30, identifier:TIME; 31, string; 32, attribute; 33, identifier:DATA; 34, string; 35, attribute; 36, identifier:SOURCE; 37, string; 38, identifier:self; 39, identifier:_KEYS; 40, string_content:aaa; 41, identifier:self; 42, identifier:_KEYS; 43, string_content:zzy; 44, identifier:self; 45, identifier:_KEYS; 46, string_content:zzz
code: def sort_func(self, key):
          """Logic for sorting keys in a `Spectrum` relative to one another."""
          if key == self._KEYS.TIME:
              return 'aaa'
          if key == self._KEYS.DATA:
              return 'zzy'
          if key == self._KEYS.SOURCE:
              return 'zzz'
          return key