def get_engine_by_slug(slug=None):

    if not slug or type(slug) is not str:
        raise TypeError("Invalid slug '%s'", slug)

    selected_engines = filter(lambda engine: hasattr(engine, "SLUG") and
                              engine.SLUG == slug, get_engines())
    if len(selected_engines) == 0:
        raise ValueError("No TTS engine found for slug '%s'" % slug)
    else:
        if len(selected_engines) > 1:
            print("WARNING: Multiple TTS engines found for slug '%s'. " +
                  "This is most certainly a bug." % slug)
        engine = selected_engines[0]
        if not engine.is_available():
            raise ValueError(("TTS engine '%s' is not available (due to " +
                              "missing dependencies, etc.)") % slug)
        return engine
Returns a typed S for this class.
dataset/ETHPy150Open jasperproject/jasper-client/client/tts.py/get_engine_by_slug--crossover with--dataset/ETHPy150Open mozilla/elasticutils/elasticutils/contrib/django/__init__.py/MappingType.search