<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _genqnmfreq(mass, spin, l, m, nmodes, qnmfreq=None):
 """Convenience function to generate QNM frequencies from lalsimulation. Parameters mass : float The mass of the black hole (in solar masses). spin : float The dimensionless spin of the black hole. l : int l-index of the harmonic. m : int m-index of the harmonic. nmodes : int The number of overtones to generate. qnmfreq : lal.COMPLEX16Vector, optional LAL vector to write the results into. Must be the same length as ``nmodes``. If None, will create one. Returns ------- lal.COMPLEX16Vector LAL vector containing the complex QNM frequencies. """

    if qnmfreq is None:
        qnmfreq = lal.CreateCOMPLEX16Vector(int(nmodes))
    lalsim.SimIMREOBGenerateQNMFreqV2fromFinal(
        qnmfreq, float(mass), float(spin), int(l), int(m), int(nmodes))
    return qnmfreq