def _resort(kernel_labels, list_to_sort):
 labels = [tko_rpc_utils.KernelString(label) for label in kernel_labels]
 resorted_pairs = sorted(zip(labels, list_to_sort))
 return [pair[1] for pair in resorted_pairs]

def _resort ( kernel_labels , list_to_sort ) : labels = [ tko_rpc_utils . KernelString ( label ) for label in kernel_labels ] resorted_pairs = sorted ( zip ( labels , list_to_sort ) ) return [ pair [ 1 ] for pair in resorted_pairs ]
resorts a list .