<s> import importlib <EOL> import sys <EOL> def createWithConfig ( module , name , conf ) : <EOL> try : <EOL> module = importlib . import_module ( module + "<STR_LIT>" . format ( name ) ) <EOL> clazz = getattr ( module , name ) <EOL> return clazz ( conf ) <EOL> except : <EOL> e = sys . exc_info ( ) [ <NUM_LIT:1> ] <EOL> raise Exception ( "<STR_LIT>" . format ( conf [ "<STR_LIT>" ] , module , e ) ) <EOL> def createWithName ( module , name ) : <EOL> try : <EOL> module = importlib . import_module ( module + "<STR_LIT>" . format ( name ) ) <EOL> clazz = getattr ( module , name ) <EOL> return clazz ( ) <EOL> except : <EOL> e = sys . exc_info ( ) [ <NUM_LIT:1> ] <EOL> raise Exception ( "<STR_LIT>" . format ( name , module , e ) ) </s>
