def dynamic_import_class(name):
import importlib<EOL>module_name, class_name = name.rsplit("<STR_LIT:.>", <NUM_LIT:1>)<EOL>try:<EOL><INDENT>module = importlib.import_module(module_name)<EOL><DEDENT>except Exception as e:<EOL><INDENT>_logger.exception("<STR_LIT>".format(name, e))<EOL>raise<EOL><DEDENT>the_class = getattr(module, class_name)<EOL>return the_class<EOL>
Import a class from a module string, e.g. ``my.module.ClassName``.