def __init__(self, language=None):
        '''
        If a `language` identifier (such as 'en_US') is provided and a matching
        language exists, it is selected. If an identifier is provided and no
        matching language exists, a NoSuchLangError exception is raised by
        self.select_language().
        If no `language` identifier is provided, we just fall back to the first
        one that is available.

        :Parameters:
            `language` : str, defaults to None
                If provided, indicates the language to be used. This needs
                to be a language identifier understood by select_language(),
                i.e. one of the options returned by list_languages().
                If nothing is provided, the first available language is used.
                If no language is available, NoLanguageSelectedError is raised.
        '''
        langs = self.list_languages()
        try:
            # If no language was specified, we just use the first one
            # that is available.
            fallback_lang = langs[0]
        except __HOLE__:
            raise NoLanguageSelectedError("No languages available!")
        self.select_language(language or fallback_lang)
dataset/ETHPy150Open kivy/kivy/kivy/core/spelling/__init__.py/SpellingBase.__init__