'Among other things, keep in in-memory sets of tuples defining installed repositories and tool dependencies along with
the relationships between each of them.  This will allow for quick discovery of those repositories or components that
can be uninstalled.  The feature allowing a Galaxy administrator to uninstall a repository should not be available to
repositories or tool dependency packages that are required by other repositories or their contents (packages). The
uninstall feature should be available only at the repository hierarchy level where every dependency will be uninstalled.
The exception for this is if an item (repository or tool dependency package) is not in an INSTALLED state - in these
cases, the specific item can be uninstalled in order to attempt re-installation.'

def __init__(self, app):

    self.app = app
    self.install_model = self.app.install_model
    self.context = self.install_model.context
    self.tool_configs = self.app.config.tool_configs
    if (self.app.config.migrated_tools_config not in self.tool_configs):
        self.tool_configs.append(self.app.config.migrated_tools_config)
    self.installed_repository_dicts = []
    self.repository_dependencies_of_installed_repositories = {}
    self.installed_repository_dependencies_of_installed_repositories = {}
    self.installed_dependent_repositories_of_installed_repositories = {}
    self.tool_dependencies_of_installed_repositories = {}
    self.installed_tool_dependencies_of_installed_repositories = {}
    self.runtime_tool_dependencies_of_installed_tool_dependencies = {}
    self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies = {}
    if app.config.manage_dependency_relationships:
        self.load_dependency_relationships()
