code: def get_headers_lang (headers):
      
      if 'Accept-Language' not in headers:
          return default_language
      languages = headers['Accept-Language'].split(",")
      # sort with preference values
      pref_languages = []
      for lang in languages:
          pref = 1.0
          if ";" in lang:
              lang, _pref = lang.split(';', 1)
              try:
                  pref = float(_pref)
              except ValueError:
                  pass
          pref_languages.append((pref, lang))
      pref_languages.sort()
      # search for lang
      for lang in (x[1] for x in pref_languages):
          if lang in supported_languages:
              return lang
      return default_language
docs: Return preferred supported language in given HTTP headers.