nodes: 0, module; 1, function_definition; 2, function_name:sortByIndex; 3, parameters; 4, block; 5, identifier:self; 6, identifier:index; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, comment:"""Implement a Index sort."""; 13, call; 14, assignment; 15, call; 16, call; 17, attribute; 18, argument_list; 19, identifier:sort_order; 20, call; 21, attribute; 22, argument_list; 23, attribute; 24, argument_list; 25, call; 26, identifier:setSortIndicatorShown; 27, True; 28, attribute; 29, argument_list; 30, call; 31, identifier:sort; 32, identifier:index; 33, identifier:sort_order; 34, identifier:self; 35, identifier:_sort_update; 36, attribute; 37, argument_list; 38, call; 39, identifier:sortIndicatorOrder; 40, attribute; 41, argument_list; 42, attribute; 43, identifier:horizontalHeader; 44, attribute; 45, argument_list; 46, attribute; 47, identifier:model; 48, identifier:self; 49, identifier:table_level; 50, attribute; 51, identifier:horizontalHeader; 52, identifier:self; 53, identifier:table_index; 54, identifier:self; 55, identifier:table_level
code: def sortByIndex(self, index):
          """Implement a Index sort."""
          self.table_level.horizontalHeader().setSortIndicatorShown(True)
          sort_order = self.table_level.horizontalHeader().sortIndicatorOrder()
          self.table_index.model().sort(index, sort_order)
          self._sort_update()