<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Example Q7
Step1:  We use a pre-existing database containing a channel library and pipeline we have established.
Step2:  Calibrating Mixers
The APS2 requires mixers to upconvert to qubit and cavity frequencies. We must tune the offset of these mixers and the amplitude factors of the quadrature channels to ensure the best possible results. We repeat the definition of the spectrum analyzer here, assuming that the LO driving this instrument is present in the channel library as spec_an_LO.
<ASSISTANT_TASK:>
Python Code:
from QGL import *
from auspex.qubit import *
Explanation: Example Q7: Single Shot Fidelity
This example notebook shows how to run single shot fidelity experiments
© Raytheon BBN Technologies 2019
End of explanation
cl = ChannelLibrary("my_config")
pl = PipelineManager()
Explanation: We use a pre-existing database containing a channel library and pipeline we have established.
End of explanation
spec_an = cl.new_spectrum_analzyer("SpecAn", "ASRL/dev/ttyACM0::INSTR", cl["spec_an_LO"])
cal = MixerCalibration(q2, spec_an, mixer="measure")
cal.calibrate()
Explanation: Calibrating Mixers
The APS2 requires mixers to upconvert to qubit and cavity frequencies. We must tune the offset of these mixers and the amplitude factors of the quadrature channels to ensure the best possible results. We repeat the definition of the spectrum analyzer here, assuming that the LO driving this instrument is present in the channel library as spec_an_LO.
End of explanation
<END_TASK>