nodes: 0, module; 1, function_definition; 2, function_name:get_event_sort_key; 3, parameters; 4, block; 5, identifier:self; 6, identifier:event_type; 7, expression_statement; 8, comment:# Process sort depending on alert type; 9, if_statement; 10, return_statement; 11, comment:"""Return the process sort key"""; 12, call; 13, comment:# Sort TOP process by memory_percent; 14, block; 15, elif_clause; 16, else_clause; 17, identifier:ret; 18, attribute; 19, argument_list; 20, expression_statement; 21, call; 22, comment:# Sort TOP process by io_counters (only for Linux OS); 23, block; 24, comment:# Default sort is...; 25, block; 26, identifier:event_type; 27, identifier:startswith; 28, string:"MEM"; 29, assignment; 30, attribute; 31, argument_list; 32, expression_statement; 33, expression_statement; 34, identifier:ret; 35, string; 36, identifier:event_type; 37, identifier:startswith; 38, string:"CPU_IOWAIT"; 39, assignment; 40, assignment; 41, string_content:memory_percent; 42, identifier:ret; 43, string; 44, identifier:ret; 45, string; 46, string_content:io_counters; 47, string_content:cpu_percent
code: def get_event_sort_key(self, event_type):
          """Return the process sort key"""
          # Process sort depending on alert type
          if event_type.startswith("MEM"):
              # Sort TOP process by memory_percent
              ret = 'memory_percent'
          elif event_type.startswith("CPU_IOWAIT"):
              # Sort TOP process by io_counters (only for Linux OS)
              ret = 'io_counters'
          else:
              # Default sort is...
              ret = 'cpu_percent'
          return ret