def get_stop_words(self, language, fail_safe=False):
try:<EOL><INDENT>language = self.language_codes[language]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>collection = self.LOADED_LANGUAGES_CACHE.get(language)<EOL>if collection is None:<EOL><INDENT>try:<EOL><INDENT>collection = self._get_stop_words(language)<EOL>self.LOADED_LANGUAGES_CACHE[language] = collection<EOL><DEDENT>except StopWordError as error:<EOL><INDENT>if not fail_safe:<EOL><INDENT>raise error<EOL><DEDENT>collection = []<EOL><DEDENT><DEDENT>stop_words = StopWord(language, collection)<EOL>return stop_words<EOL>
Returns a StopWord object initialized with the stop words collection
requested by ``language``.
If the requested language is not available a StopWordError is raised.
If ``fail_safe`` is set to True, an empty StopWord object is returned.