def METHOD_NAME(request):
    accept = request.META.get("HTTP_ACCEPT_LANGUAGE", "")
    for accept_lang, unused in parse_accept_lang_header(accept):
        if accept_lang == "*":
            break
        if not language_code_re.search(accept_lang):
            continue
        try:
            return get_supported_language_variant(accept_lang)
        except LookupError:
            continue