<s> from wlauto . core . bootstrap import settings <EOL> from wlauto . core . extension import Extension <EOL> from wlauto . utils . misc import load_class <EOL> _extension_bases = { ext . name : load_class ( ext . cls ) for ext in settings . extensions } <EOL> def get_extension_type ( ext ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( ext , Extension ) : <EOL> raise ValueError ( '<STR_LIT>' . format ( ext ) ) <EOL> for name , cls in _extension_bases . iteritems ( ) : <EOL> if isinstance ( ext , cls ) : <EOL> return name <EOL> raise ValueError ( '<STR_LIT>' . format ( ext . __class__ . __name__ ) ) </s>
