<s> from importlib import import_module <EOL> def load_class ( path ) : <EOL> """<STR_LIT>""" <EOL> mod_name , klass_name = None , None <EOL> try : <EOL> mod_name , klass_name = path . rsplit ( '<STR_LIT:.>' , <NUM_LIT:1> ) <EOL> mod = import_module ( mod_name ) <EOL> except AttributeError as e : <EOL> raise RuntimeError ( "<STR_LIT>" . format ( mod_name , e ) ) <EOL> try : <EOL> klass = getattr ( mod , klass_name ) <EOL> except AttributeError : <EOL> raise RuntimeError ( '<STR_LIT>' . format ( mod_name , klass_name ) ) <EOL> return klass </s>
