def _import(class_path):

    bits = class_path.split('.')
    mod_name = '.'.join(bits[:-1])
    cls_name = bits[-1]

    mod = __import__(mod_name, None, None, cls_name)

    return getattr(mod, cls_name)
Imports a module or class from a string in dot notation.
dataset/ETHPy150Open tooxie/shiva-server/shiva/utils.py/_import