def get_object(name):
    """Get an object from a Python module, or a module itself.

    Arguments:
        name:
            Python path name of object. Usually a module or a class in a module.

    Returns:
        An object identified by the given path name. may raise AttributeError
        or ModuleImportError if name not found.
    """
    try:
        return sys.modules[name]
    except KeyError:
        pass
    i = name.rfind(".")
    if i >= 0:
        try:
            __import__(name)
        except __HOLE__:
            pass
        else:
            return sys.modules[name]
        mod = get_module(name[:i]) # module name component
        try:
            return getattr(mod, name[i+1:]) # path tail is an object inside module
        except AttributeError:
            raise ObjectImportError("%r not found in %r." % (name[i+1:], mod.__name__))
    else:
        return get_module(name) # basic module name
dataset/ETHPy150Open kdart/pycopia/aid/pycopia/module.py/get_object