(ls)
return list(set(ls))
expects a list of language codes and returns a unique lost of the first
    part of all items. obviously invalid entries are skipped

    >>> sanitize_language_codes(['de-at', 'de-ch'])
    ['de']

    >>> set(sanitize_language_codes(['de-at', 'en', 'en-gb', '(asdf', 'Deutsch'])) == {'de', 'en'}
    True
expects a list of language codes and returns a unique lost of the first
    part of all items. obviously invalid entries are skipped
expects a list of language codes and returns a unique lost of the first part of all items . obviously invalid entries are skipped
def sanitize_language_codes(ls):
    """
    expects a list of language codes and returns a unique lost of the first
    part of all items. obviously invalid entries are skipped

    >>> sanitize_language_codes(['de-at', 'de-ch'])
    ['de']

    >>> set(sanitize_language_codes(['de-at', 'en', 'en-gb', '(asdf', 'Deutsch'])) == {'de', 'en'}
    True
    """

    ls = [sanitize_language_code(l) for l in ls if l and RE_LANG.match(l)]
    return list(set(ls))
def sanitize_language_codes ( ls ) : ls = [ sanitize_language_code ( l ) for l in ls if l and RE_LANG . match ( l ) ] return list ( set ( ls ) )