<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)