def package_of(pkg_or_module):
 pkg_name = package_name(pkg_or_module)
 __import__(pkg_name)
 return sys.modules[pkg_name]

def package_of ( pkg_or_module ) : pkg_name = package_name ( pkg_or_module ) __import__ ( pkg_name ) return sys . modules [ pkg_name ]
return the package of a module or return the package itself .