<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_lm_f0tau_allmodes(mass, spin, modes):
 """Returns a dictionary of all of the frequencies and damping times for the requested modes. Parameters mass : float or array Mass of the black hole (in solar masses). spin : float or array Dimensionless spin of the final black hole. modes : list of str The modes to get. Each string in the list should be formatted 'lmN', where l (m) is the l (m) index of the harmonic and N is the number of overtones to generate (note, N is not the index of the overtone). For example, '221' will generate the 0th overtone of the l = m = 2 mode. Returns ------- f0 : dict Dictionary mapping the modes to the frequencies. The dictionary keys are 'lmn' string, where l (m) is the l (m) index of the harmonic and n is the index of the overtone. For example, '220' is the l = m = 2 mode and the 0th overtone. tau : dict Dictionary mapping the modes to the damping times. The keys are the same as ``f0``. """

    f0, tau = {}, {}
    key = '{}{}{}'
    for lmn in modes:
        l, m, nmodes = int(lmn[0]), int(lmn[1]), int(lmn[2])
        tmp_f0, tmp_tau = get_lm_f0tau(mass, spin, l, m, nmodes)
        if nmodes == 1:
            # in this case, tmp_f0 and tmp_tau will just be floats
            f0[key.format(l, m, '0')] = tmp_f0
            tau[key.format(l, m, '0')] = tmp_tau
        else:
            for n in range(nmodes):
                # we need to wrap tmp_f0 with formatreturn to ensure that if
                # only a mass, spin pair was requested, the value stored to
                # the dict is a float
                f0[key.format(l, m, n)] = formatreturn(tmp_f0[..., n])
                tau[key.format(l, m, n)] = formatreturn(tmp_tau[..., n])
    return f0, tau