nodes: 0, module; 1, function_definition; 2, function_name:sort_candidate_pairs; 3, parameters; 4, block; 5, identifier:pairs; 6, identifier:ice_controlling; 7, expression_statement; 8, function_definition; 9, expression_statement; 10, comment:"""
      Sort a list of candidate pairs.
      """; 11, function_name:pair_priority; 12, parameters; 13, block; 14, call; 15, identifier:pair; 16, return_statement; 17, attribute; 18, argument_list; 19, unary_operator; 20, identifier:pairs; 21, identifier:sort; 22, keyword_argument; 23, call; 24, identifier:key; 25, identifier:pair_priority; 26, identifier:candidate_pair_priority; 27, argument_list; 28, attribute; 29, attribute; 30, identifier:ice_controlling; 31, identifier:pair; 32, identifier:local_candidate; 33, identifier:pair; 34, identifier:remote_candidate
code: def sort_candidate_pairs(pairs, ice_controlling):
      """
      Sort a list of candidate pairs.
      """
      def pair_priority(pair):
          return -candidate_pair_priority(pair.local_candidate,
                                          pair.remote_candidate,
                                          ice_controlling)
  
      pairs.sort(key=pair_priority)