def METHOD_NAME(data: ResonatorFrequencyData) -> ResonatorFrequencyResults:
    """Post-Processing for Optimization RO frequency"""
    qubits = data.qubits
    fidelities_dict = {}
    best_freqs = {}
    for qubit in qubits:
        fidelities = []
        freqs = data.unique_freqs(qubit)
        for freq in freqs:
            fit_method = QubitFit()
            data_freq = data[qubit][data[qubit]["freq"] == freq]
            iq_couples = np.array(data_freq[["i", "q"]].tolist())[:, :]
            states = np.array(data_freq[["state"]].tolist())[:, 0]
            fit_method.fit(iq_couples, states)
            fidelities.append(fit_method.assignment_fidelity)
        fidelities_dict[qubit] = fidelities
        best_freqs[qubit] = freqs[np.argmax(fidelities_dict[qubit])]
    return ResonatorFrequencyResults(
        fidelities=fidelities_dict,
        best_freq=best_freqs,
    )