nodes: 0, module; 1, function_definition; 2, function_name:sort; 3, parameters; 4, block; 5, identifier:self; 6, identifier:values; 7, expression_statement; 8, for_statement; 9, comment:"""Sort the values in-place based on the connectors in the network."""; 10, identifier:level; 11, identifier:self; 12, block; 13, for_statement; 14, pattern_list; 15, identifier:level; 16, block; 17, identifier:wire1; 18, identifier:wire2; 19, if_statement; 20, comparison_operator:values[wire1] > values[wire2]; 21, block; 22, subscript; 23, subscript; 24, expression_statement; 25, identifier:values; 26, identifier:wire1; 27, identifier:values; 28, identifier:wire2; 29, assignment; 30, pattern_list; 31, expression_list; 32, subscript; 33, subscript; 34, subscript; 35, subscript; 36, identifier:values; 37, identifier:wire1; 38, identifier:values; 39, identifier:wire2; 40, identifier:values; 41, identifier:wire2; 42, identifier:values; 43, identifier:wire1
code: def sort(self, values):
          """Sort the values in-place based on the connectors in the network."""
          for level in self:
              for wire1, wire2 in level:
                  if values[wire1] > values[wire2]:
                      values[wire1], values[wire2] = values[wire2], values[wire1]