def load_path_attr(path):
    i = path.rfind(".")
    module, attr = path[:i], path[i + 1:]
    try:
        mod = importlib.import_module(module)
    except __HOLE__ as e:
        raise ImproperlyConfigured(
            "Error importing {0}: '{1}'".format(module, e))
    try:
        attr = getattr(mod, attr)
    except AttributeError:
        raise ImproperlyConfigured(
            "Module '{0}' does not define a '{1}'".format(module, attr))
    return attr
dataset/ETHPy150Open haystack/eyebrowse-server/notifications/conf.py/load_path_attr