def class_from_module(path, defaultpaths=None):
    """
    Return a class from a module, given the module's path. This is
    primarily used to convert db_typeclass_path:s to classes.

    Args:
        path (str): Full Python dot-path to module.
        defaultpaths (iterable, optional): If a direc import from `path` fails,
            try subsequent imports by prepending those paths to `path`.

    Returns:
        class (Class): An uninstatiated class recovered from path.

    Raises:
        ImportError: If all loading failed.

    """
    cls = None
    if defaultpaths:
        paths = [path] + ["%s.%s" % (dpath, path) for dpath in make_iter(defaultpaths)] if defaultpaths else []
    else:
        paths = [path]

    for testpath in paths:
        if "." in path:
            testpath, clsname = testpath.rsplit(".", 1)
        else:
            raise ImportError("the path '%s' is not on the form modulepath.Classname." % path)
        try:
            mod = import_module(testpath, package="evennia")
        except ImportError:
            if len(trace()) > 2:
                # this means the error happened within the called module and
                # we must not hide it.
                exc = sys.exc_info()
                raise_(exc[1], None, exc[2])
            else:
                # otherwise, try the next suggested path
                continue
        try:
            cls = getattr(mod, clsname)
            break
        except __HOLE__:
            if len(trace()) > 2:
                # AttributeError within the module, don't hide it
                exc = sys.exc_info()
                raise_(exc[1], None, exc[2])
    if not cls:
        err = "Could not load typeclass '%s'" % path
        if defaultpaths:
            err += "\nPaths searched:\n    %s" % "\n    ".join(paths)
        else:
            err += "."
        raise ImportError(err)
    return cls
# alias
dataset/ETHPy150Open evennia/evennia/evennia/utils/utils.py/class_from_module