def dynamic_import(str_import):
    mod, cla = str_import.rsplit('.', 1)
    dyn_import = getattr(__import__(mod, fromlist=[str(cla)]), cla)
    return dyn_import
Take a string representing a python function or class and import it.
dataset/ETHPy150Open BenoitDamota/mempamal/mempamal/dynamic.py/dynamic_import