def METHOD_NAME(lang):
    # TODO: @Foo and charset handling
    lang = re.sub('[@.].*$', '', lang)
    if lang in LANGUAGES:
        return True
    ix = lang.find('_')
    if ix == -1:
        return False
    # TODO: don't accept all lang_COUNTRY combinations
    country = lang[ix + 1:]
    if country not in COUNTRIES:
        return False
    lang = lang[0:ix]
    if lang not in LANGUAGES:
        return False
    return True