def _choose_front_id_from_candidates(candidate_offset_front_ids, offset_fronts, offsets_corresponding_to_onsets):
noverlaps = []  <EOL>for offset_front_id in candidate_offset_front_ids:<EOL><INDENT>offset_front_f_idxs, offset_front_s_idxs = np.where(offset_fronts == offset_front_id)<EOL>offset_front_idxs = [(f, i) for f, i in zip(offset_front_f_idxs, offset_front_s_idxs)]<EOL>noverlap_this_id = len(set(offset_front_idxs).symmetric_difference(set(offsets_corresponding_to_onsets)))<EOL>noverlaps.append((noverlap_this_id, offset_front_id))<EOL><DEDENT>_overlapped, chosen_offset_front_id = max(noverlaps, key=lambda t: t[<NUM_LIT:0>])<EOL>return int(chosen_offset_front_id)<EOL>
Returns a front ID which is the id of the offset front that contains the most overlap
with offsets that correspond to the given onset front ID.