def METHOD_NAME(units: str, unicode=False) -> str:
    """
    Mainly used for phonons.
    Return latex string from ``units``.
    If unicode is True, replace Latex superscript with unitcode.
    """
    d = {"ev": "(eV)", "mev": "(meV)", "ha": '(Ha)',
         "cm-1": "(cm$^{-1}$)", 'cm^-1': "(cm$^{-1}$)", "thz": '(Thz)',
         }
    try:
        s = d[units.lower().strip()]
    except KeyError:
        raise KeyError('Value for units `{}` unknown\nPossible values are:\n {}'.format(units, list(d.keys())))
    if unicode:
        s = s.replace('$^{-1}$', '⁻¹')
    return s