def remove_package(self, package):
        """Removes an entire package from the registry.
        """
        # graph is the class hierarchy graph for this subset
        graph = Graph()
        if package.identifier not in self.packages:
            raise MissingPackage(package.identifier)
        package = self.packages[package.identifier]
        for descriptor in package.descriptor_list:
            graph.add_vertex(descriptor.sigstring)
        for descriptor in package.descriptor_list:
            base_id = descriptor.base_descriptor_id
            if base_id in package.descriptors_by_id:
                base_descriptor = \
                    package.descriptors_by_id[descriptor.base_descriptor_id]
                graph.add_edge(descriptor.sigstring, base_descriptor.sigstring)

        top_sort = graph.vertices_topological_sort()
        # set up fast removal of model
        for sigstring in top_sort:
            self.delete_module(
                *vistrails.core.modules.utils.parse_descriptor_string(sigstring))

        # Remove upgraded package subworkflows from registry
        for key, version_dict in package._abs_pkg_upgrades.iteritems():
            for version, descriptor in version_dict.iteritems():
                self.delete_module(descriptor.identifier, descriptor.name,
                                   descriptor.namespace)
        package._abs_pkg_upgrades.clear()

        package.unload()
        self.delete_package(package)
        self.signals.emit_deleted_package(package)
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/core/modules/module_registry.py/ModuleRegistry.remove_package/original