<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def detunings_code(Neu, Nl, pairs, omega_levelu, iu0, ju0):
 r"""Get the code to calculate the simplified detunings. delta1_2_1 = detuning_knob[0] delta2_3_1 = detuning_knob[1] delta2_4_1 = detuning_knob[1] + (-100.0) <BLANKLINE> """

    code_det = ""
    for l in range(Nl):
        for pair in pairs[l]:
            iu, ju = pair
            code_det += "    delta"+str(l+1)
            code_det += "_"+str(iu+1)
            code_det += "_"+str(ju+1)
            code_det += " = detuning_knob["+str(l)+"]"
            corr = -omega_levelu[iu]+omega_levelu[iu0[l]]
            corr = -omega_levelu[ju0[l]]+omega_levelu[ju] + corr

            if corr != 0:
                code_det += " + ("+str(corr)+")"
            code_det += "\n"
    return code_det