def find_playlist_changes(orig_tracks, modified_tracks):
 s_pairs = get_id_pairs(orig_tracks)
 d_pairs = get_id_pairs(modified_tracks)
 s_count = Counter(s_pairs)
 d_count = Counter(d_pairs)
 to_del = (s_count - d_count)
 to_add = (d_count - s_count)
 to_keep = set((s_count & d_count))
 return (to_del, to_add, to_keep)

def find_playlist_changes ( orig_tracks , modified_tracks ) : s_pairs = get_id_pairs ( orig_tracks ) d_pairs = get_id_pairs ( modified_tracks ) s_count = Counter ( s_pairs ) d_count = Counter ( d_pairs ) to_del = ( s_count - d_count ) to_add = ( d_count - s_count ) to_keep = set ( ( s_count & d_count ) ) return ( to_del , to_add , to_keep )
finds the changes between two playlists .