def load_class(path):
    """
    Load class from path.
    """

    mod_name, klass_name = None, None

    try:
        mod_name, klass_name = path.rsplit('.', 1)
        mod = import_module(mod_name)
    except AttributeError as e:
        raise RuntimeError("Error importing {0}: '{1}'".format(mod_name, e))

    try:
        klass = getattr(mod, klass_name)
    except __HOLE__:
        raise RuntimeError('Module "{0}" does not define a "{1}" class'.format(mod_name, klass_name))

    return klass
dataset/ETHPy150Open niwinz/tornado-webtools/webtools/utils/imp.py/load_class