def _load(name, motherClass):
    try:
        moduleName, cls = name.rsplit(".", 1)
    except __HOLE__:
        raise JobTypeImportError("Invalid job type name '%s'. It should be like 'some.module.JobClassName'." % name)

    try:
        module = __import__(moduleName, fromlist=[cls])
    except ImportError, error:
        traceback.print_exc()
        raise JobTypeImportError("No module '%s' on PYTHONPATH:\n%s. (%s)" % (moduleName, "\n".join(sys.path), error))

    try:
        jobtype = getattr(module, cls)
    except AttributeError:
        raise JobTypeImportError("No such job type '%s' defined in module '%s'." % (cls, name))

    if not issubclass(jobtype, motherClass):
        motherClassName = "%s.%s" % (motherClass.__module__, motherClass.__name__)
        raise JobTypeImportError("%s (loaded as '%s') is not a valid %s." % (jobtype, name, motherClassName))

    return jobtype
dataset/ETHPy150Open mikrosimage/OpenRenderManagement/src/puliclient/jobs.py/_load