def my_import(name):
    try:
        imp = __import__(name)
    except __HOLE__ as err:
        raise JobError("Failed to import %s with error %s" % (name, err))

    mods = name.split('.')
    if len(mods) > 1:
        for mod in mods[1:]:
            imp = getattr(imp, mod)
    return imp
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/jobs.py/my_import