Check for language availability and presence of tagger files.
        :param lang: The language argument given to the class.
        :type lang: str
        :rtype : dict
771203
def _setup_language_variables(self, lang: str):  # pylint: disable=no-self-use
        
        assert lang in TAGGERS.keys(), \
            'POS tagger not available for {0} language.'.format(lang)
        rel_path = os.path.join('~/cltk_data',
                                lang,
                                'model/' + lang + '_models_cltk/taggers/pos')  # pylint: disable=C0301
        path = os.path.expanduser(rel_path)
        tagger_paths = {}
        for tagger_key, tagger_val in TAGGERS[lang].items():
            tagger_path = os.path.join(path, tagger_val)
            assert os.path.isfile(tagger_path), \
                'CLTK linguistics models not available for {0}, looking for .'.format([tagger_val, tagger_path])
            tagger_paths[tagger_key] = tagger_path
        return tagger_paths
1028515
def get_path(language):
  '''  '''
  filename = language.lower() + '.json'
  lang_file_path = os.path.join(_DEFAULT_DIR, filename)
  if not os.path.exists(lang_file_path):
    raise IOError('Could not find {} language file'.format(language))
  return lang_file_path
992559
function (lang) {
		if (lang_data[lang] && lang_data[lang].success_callbacks && lang_data[lang].success_callbacks.length) {
			lang_data[lang].success_callbacks.forEach(function (f) {
				f(lang);
			});
		}
	}
1257414
def visitLanguageRange(self, ctx: ShExDocParser.LanguageRangeContext):
        
        baselang = ctx.LANGTAG().getText()
        if not ctx.STEM_MARK():                 # valueSetValue = objectValue / objectValue = ObjectLiteral
            vsvalue = Language()
            vsvalue.languageTag = baselang[1:]
        else:
            if ctx.languageExclusion():
                vsvalue = LanguageStemRange(LANGTAG(baselang[1:]), exclusions=[])
                self._language_exclusions(vsvalue, ctx.languageExclusion())
            else:
                vsvalue = LanguageStem(LANGTAG(baselang[1:]))
        self.nodeconstraint.values.append(vsvalue)
954471
def missing(self):
        
        if self.type == BOOLEAN:
            Log.error("programmer error")
        return self.lang[MissingOp(self)]
1069368
def poll_open_file_languages(self):
        """"""
        languages = []
        for index in range(self.get_stack_count()):
            languages.append(
                self.tabs.widget(index).language.lower())
        return set(languages)
82811
def detect_language(lang, kernel_source):
    """"""
    if lang is None:
        if callable(kernel_source):
            raise TypeError("Please specify language when using a code generator function")
        kernel_string = get_kernel_string(kernel_source)
        if "__global__" in kernel_string:
            lang = "CUDA"
        elif "__kernel" in kernel_string:
            lang = "OpenCL"
        else:
            lang = "C"
    return lang
1168497
def get_translation_from_instance(instance, lang):
        
        try:
            translation = get_translation(instance, lang)
        except (AttributeError, ObjectDoesNotExist):
            translation = None
        return translation
1215780
def __get_supported_file_types_string(self):
        

        languages = ["All Files (*)"]
        for language in self.__languages_model.languages:
            languages.append("{0} Files ({1})".format(language.name,
                                                      " ".join(language.extensions.split("|")).replace("\\", "*")))
        return ";;".join(languages)
1147387
def translation(language):
    
    global _translations
    if language not in _translations:
        _translations[language] = Translations(language)
    return _translations[language]
590905
def load_lang_conf():
    
    if osp.isfile(LANG_FILE):
        with open(LANG_FILE, 'r') as f:
            lang = f.read()
    else:
        lang = get_interface_language()
        save_lang_conf(lang)

    # Save language again if it's been disabled
    if lang.strip('\n') in DISABLED_LANGUAGES:
        lang = DEFAULT_LANGUAGE
        save_lang_conf(lang)

    return lang
985586
def has(self, lang, instance):
        
        instance_key = TransCache._create_key(lang, instance)
        return instance_key in self.cache
526160
function scan(language) {
            var i;
            for (i = 0; i < availableLanguages.length; i += 1) {
                if (language.toLowerCase() === availableLanguages[i].toLowerCase()) {
                    return availableLanguages[i];
                }
            }
        }
214248
def get_available_languages(self, obj):
        
        return obj.available_languages if obj is not None else self.model.objects.none()
808638
def language(cls):
        
        lang = 'Unknown (%s)' % cls.lang
        if pycountry is None:
            if cls.lang in languages.Languages:
                lang = languages.Languages[cls.lang]
        else:
            try:
                lang = pycountry.languages.get(alpha2 = cls.lang).name
            except KeyError:
                try:
                    lang = pycountry.languages.get(iso639_1_code = cls.lang).name
                except KeyError:
                    pass
        return lang
979123
def IsValidLanguageCode(lang):
  
  bcp47_obj = parser.ParseLanguage(str(lang.lower()))
  return bcp47_obj.IsWellformed() and bcp47_obj.IsValid()
773728
def _is_lang_change(self, request):
        """"""
        if 'lang' not in request.GET:
            return False

        return not any(request.path.endswith(url) for url in self.exempt_urls)