<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def locale_negotiator(request):
 """Locale negotiator base on the `Accept-Language` header"""

    locale = 'en'
    if request.accept_language:
        locale = request.accept_language.best_match(LANGUAGES)
        locale = LANGUAGES.get(locale, 'en')
    return locale