code: def freq_units(units):
      
  
      d = {"thz": FreqUnits(1, "THz"),
           "ev": FreqUnits(const.value("hertz-electron volt relationship") * const.tera, "eV"),
           "mev": FreqUnits(const.value("hertz-electron volt relationship") * const.tera / const.milli, "meV"),
           "ha": FreqUnits(const.value("hertz-hartree relationship") * const.tera, "Ha"),
           "cm-1": FreqUnits(const.value("hertz-inverse meter relationship") * const.tera * const.centi, "cm^{-1}"),
           'cm^-1': FreqUnits(const.value("hertz-inverse meter relationship") * const.tera * const.centi, "cm^{-1}")
           }
      try:
          return d[units.lower().strip()]
      except KeyError:
          raise KeyError('Value for units `{}` unknown\nPossible values are:\n {}'.format(units, list(d.keys())))
docs: Returns conversion factor from THz to the requred units and the label in the form of a namedtuple
      Accepted values: thz, ev, mev, ha, cm-1, cm^-1