def get(cls, code: str) -> "Locale":
        """Returns the Locale for the given locale code.

        If it is not supported, we raise an exception.
        """
        if code not in cls._cache:
            assert code in _supported_locales
            translations = _translations.get(code, None)
            if translations is None:
                locale = CSVLocale(code, {})  # type: Locale
            elif _use_gettext:
                locale = GettextLocale(code, translations)
            else:
                locale = CSVLocale(code, translations)
            cls._cache[code] = locale
        return cls._cache[code]
def get ( cls , code : str ) -> "Locale" : if code not in cls . _cache : assert code in _supported_locales translations = _translations . get ( code , None ) if translations is None : locale = CSVLocale ( code , { } ) elif _use_gettext : locale = GettextLocale ( code , translations ) else : locale = CSVLocale ( code , translations ) cls . _cache [ code ] = locale return cls . _cache [ code ]
Returns the Locale for the given locale code.

        If it is not supported, we raise an exception.