def is_proper_module(obj):
    return (inspect.ismodule(obj) and
            obj is sys.modules.get(getattr(obj, '__name__', None)))


#
# Internal helpers
#
Returns ``True`` if ``obj`` can be treated like a garbage collector root.
dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/dep/objgraph.py/is_proper_module