nodes: 0, module; 1, function_definition; 2, function_name:get_transition_chempots; 3, parameters; 4, block; 5, identifier:self; 6, identifier:element; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, for_statement; 11, expression_statement; 12, for_statement; 13, expression_statement; 14, return_statement; 15, comment:"""
          Get the critical chemical potentials for an element in the Phase
          Diagram.
  
          Args:
              element: An element. Has to be in the PD in the first place.
  
          Returns:
              A sorted sequence of critical chemical potentials, from less
              negative to more negative.
          """; 16, comparison_operator:element not in self.elements; 17, block; 18, assignment; 19, identifier:facet; 20, attribute; 21, block; 22, assignment; 23, identifier:c; 24, call; 25, block; 26, call; 27, call; 28, identifier:element; 29, attribute; 30, raise_statement; 31, identifier:critical_chempots; 32, list; 33, identifier:self; 34, identifier:facets; 35, expression_statement; 36, expression_statement; 37, identifier:clean_pots; 38, list; 39, identifier:sorted; 40, argument_list; 41, if_statement; 42, attribute; 43, argument_list; 44, identifier:tuple; 45, argument_list; 46, identifier:self; 47, identifier:elements; 48, call; 49, assignment; 50, call; 51, identifier:critical_chempots; 52, comparison_operator:len(clean_pots) == 0; 53, block; 54, else_clause; 55, identifier:clean_pots; 56, identifier:reverse; 57, identifier:clean_pots; 58, identifier:ValueError; 59, argument_list; 60, identifier:chempots; 61, call; 62, attribute; 63, argument_list; 64, call; 65, integer:0; 66, expression_statement; 67, block; 68, concatenated_string; 69, attribute; 70, argument_list; 71, identifier:critical_chempots; 72, identifier:append; 73, subscript; 74, identifier:len; 75, argument_list; 76, call; 77, if_statement; 78, string:"get_transition_chempots can only be called with "; 79, string:"elements in the phase diagram."; 80, identifier:self; 81, identifier:_get_facet_chempots; 82, identifier:facet; 83, identifier:chempots; 84, identifier:element; 85, identifier:clean_pots; 86, attribute; 87, argument_list; 88, comparison_operator:abs(c - clean_pots[-1]) > PhaseDiagram.numerical_tol; 89, block; 90, identifier:clean_pots; 91, identifier:append; 92, identifier:c; 93, call; 94, attribute; 95, expression_statement; 96, identifier:abs; 97, argument_list; 98, identifier:PhaseDiagram; 99, identifier:numerical_tol; 100, call; 101, binary_operator:c - clean_pots[-1]; 102, attribute; 103, argument_list; 104, identifier:c; 105, subscript; 106, identifier:clean_pots; 107, identifier:append; 108, identifier:c; 109, identifier:clean_pots; 110, unary_operator; 111, integer:1
code: def get_transition_chempots(self, element):
          """
          Get the critical chemical potentials for an element in the Phase
          Diagram.
  
          Args:
              element: An element. Has to be in the PD in the first place.
  
          Returns:
              A sorted sequence of critical chemical potentials, from less
              negative to more negative.
          """
          if element not in self.elements:
              raise ValueError("get_transition_chempots can only be called with "
                               "elements in the phase diagram.")
  
          critical_chempots = []
          for facet in self.facets:
              chempots = self._get_facet_chempots(facet)
              critical_chempots.append(chempots[element])
  
          clean_pots = []
          for c in sorted(critical_chempots):
              if len(clean_pots) == 0:
                  clean_pots.append(c)
              else:
                  if abs(c - clean_pots[-1]) > PhaseDiagram.numerical_tol:
                      clean_pots.append(c)
          clean_pots.reverse()
          return tuple(clean_pots)