parameters: (self, package)
docstring: Take a package name or module object and return the module.
  
          If a name, the module is imported.  If the passed or imported module
          object is not a package, raise an exception.
docstring_summary: Take a package name or module object and return the module.
docstring_tokens: Take a package name or module object and return the module .
function: def _get_package(self, package):
          """Take a package name or module object and return the module.
  
          If a name, the module is imported.  If the passed or imported module
          object is not a package, raise an exception.
          """
          if hasattr(package, "__spec__"):
              if package.__spec__.submodule_search_locations is None:
                  raise TypeError("{!r} is not a package".format(package.__spec__.name))
              else:
                  return package
          else:
              module = self.import_module(package)
              if module.__spec__.submodule_search_locations is None:
                  raise TypeError("{!r} is not a package".format(package))
              else:
                  return module
function_tokens: def _get_package ( self , package ) : if hasattr ( package , "__spec__" ) : if package . __spec__ . submodule_search_locations is None : raise TypeError ( "{!r} is not a package" . format ( package . __spec__ . name ) ) else : return package else : module = self . import_module ( package ) if module . __spec__ . submodule_search_locations is None : raise TypeError ( "{!r} is not a package" . format ( package ) ) else : return module