Context manager to override the instance language.
970667
def override_language(self, language):
        
        previous_language = self._linguist.language
        self._linguist.language = language
        yield
        self._linguist.language = previous_language
845725
def override_locale(self, locale: str = locales.EN,
                        ) -> Generator['BaseDataProvider', None, None]:
        
        try:
            origin_locale = self.locale
            self._override_locale(locale)
            try:
                yield self
            finally:
                self._override_locale(origin_locale)
        except AttributeError:
            raise ValueError('«{}» has not locale dependent'.format(
                self.__class__.__name__))
1276354
function(language, patterns, bypass) {

            // if there is only one argument then we assume that we want to
            // extend the default language rules
            if (arguments.length == 1) {
                patterns = language;
                language = DEFAULT_LANGUAGE;
            }

            bypass_defaults[language] = bypass;
            language_patterns[language] = patterns.concat(language_patterns[language] || []);
        }
946902
protected function overrideLangJS(): void
    {
        // Bind the Laravel JS Localization command into the app IOC.
        $this->app->singleton('localization.js', function ($app) {
            $app = $this->app;
            $laravelMajorVersion = (int) $app::VERSION;

            $files = $app['files'];

            if ($laravelMajorVersion === 4) {
                $langs = $app['path.base'].'/app/lang';
            } elseif ($laravelMajorVersion === 5) {
                $langs = $app['path.base'].'/resources/lang';
            }
            $messages = $app['config']->get('localization-js.messages');
            $generator = new LangJsGenerator($files, $langs, $messages);

            return new LangJsCommand($generator);
        });

        // Bind the Laravel JS Localization command into Laravel Artisan.
        $this->commands('localization.js');
    }
972813
def inside_new_context(klass, *args)
      new_context = append_new_context(klass, *args)

      orig, self.current_context = current_context, new_context
      yield
      self.current_context = orig
    end
636456
def lang_items(self, lang=None):
        """"""
        if lang is None:
            lang = self.language
        yield from self.cache.setdefault(lang, {}).items()
1245965
private void initCapitalizationContextInfo(ULocale locale) {
        ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, locale);
        try {
            ICUResourceBundle rdb = rb.getWithFallback("contextTransforms/relative");
            int[] intVector = rdb.getIntVector();
            if (intVector.length >= 2) {
                capitalizationOfRelativeUnitsForListOrMenu = (intVector[0] != 0);
                capitalizationOfRelativeUnitsForStandAlone = (intVector[1] != 0);
            }
        } catch (MissingResourceException e) {
            // use default
        }
    }
1207006
def get_context(self, language):
        
        context = self.gettext(language, self._context) if self._context else ""
        vals = self._hook_manager.call_hook('task_context', course=self.get_course(), task=self, default=context)
        return ParsableText(vals[0], "rst", self._translations.get(language, gettext.NullTranslations())) if len(vals) \
            else ParsableText(context, "rst", self._translations.get(language, gettext.NullTranslations()))
353
def filtered_context(context):
    """"""

    ctx = Context(context.opt)
    for resource in context.resources():
        if resource.child:
            continue

        if resource.filtered():
            ctx.add(resource)

    return ctx
1209448
public static RuleManager getInstance(Language language, Boolean load_temponym_resources) {
		if(!instances.containsKey(language.getName())) {
			RuleManager nm = new RuleManager(language.getResourceFolder(), load_temponym_resources);
			instances.put(language.getName(), nm);
		}
		
		return instances.get(language.getName());
	}
593524
def make_context(self, **kwargs):
        """"""
        self.check_schema()
        return Context(self.driver, self.config, **kwargs)
784270
def set(self, language: str, value: str):
        

        self[language] = value
        self.__dict__.update(self)
        return self
386871
def override(self, obj):
        """"""
        for field in obj.__class__.export_fields:
            setattr(self, field, getattr(obj, field))
1291069
def default_language_from_metadata_and_ext(metadata, ext):
    """"""
    default_from_ext = _SCRIPT_EXTENSIONS.get(ext, {}).get('language', 'python')

    language = (metadata.get('jupytext', {}).get('main_language')
                or metadata.get('kernelspec', {}).get('language')
                or default_from_ext)

    if language.startswith('C++'):
        language = 'c++'

    return language
1311707
protected static function setTranslationsForMessageFromService($selfEdit, $msgInstanceName, $language, $translations) {
		$translationService = new InstanceProxy($msgInstanceName, $selfEdit);
		return $translationService->setMessages($translations, $language);
	}
408431
protected IExtraLanguageGeneratorContext createGeneratorContext(IFileSystemAccess2 fsa, IGeneratorContext context,
			Resource resource) {
		if (context instanceof IExtraLanguageGeneratorContext) {
			return (IExtraLanguageGeneratorContext) context;
		}
		return new ExtraLanguageGeneratorContext(context, fsa, this, resource, getPreferenceID());
	}
343797
def set_context(context):
    """"""
    global _context
    _context = {k: v for k, v in context.items()}