code: def IsValidLanguageCode(lang):
    
    bcp47_obj = parser.ParseLanguage(str(lang.lower()))
    return bcp47_obj.IsWellformed() and bcp47_obj.IsValid()
docs: Checks the validity of a language code value:
      - checks whether the code, as lower case, is well formed and valid BCP47
        using the pybcp47 module