code: def lm_amps_phases(**kwargs):
      
      l, m = kwargs['l'], kwargs['m']
      amps, phis = {}, {}
      # amp220 is always required, because the amplitudes of subdominant modes
      # are given as fractions of amp220.
      try:
          amps['220'] = kwargs['amp220']
      except KeyError:
          raise ValueError('amp220 is always required')
  
      # Get amplitudes of subdominant modes and all phases
      for n in range(kwargs['nmodes']):
          # If it is the 22 mode, skip 220
          if (l, m, n) != (2, 2, 0):
              try:
                  amps['%d%d%d' %(l,m,n)] = kwargs['amp%d%d%d' %(l,m,n)] * amps['220']
              except KeyError:
                  raise ValueError('amp%d%d%d is required' %(l,m,n))
          try:
              phis['%d%d%d' %(l,m,n)] = kwargs['phi%d%d%d' %(l,m,n)]
          except KeyError:
              raise ValueError('phi%d%d%d is required' %(l,m,n))
  
      return amps, phis
docs: Take input_params and return dictionaries with amplitudes and phases
      of each overtone of a specific lm mode, checking that all of them are given.