def best_match_language(req):
 if (not req.accept_language):
  return None
 return req.accept_language.best_match(oslo_i18n.get_available_languages('keystone'))

def best_match_language ( req ) : if ( not req . accept_language ) : return None return req . accept_language . best_match ( oslo_i18n . get_available_languages ( 'keystone' ) )
determine the best available locale .