'Activate an installed tool shed repository that has been marked as deactivated.'

def activate_repository(self, repository):

    (shed_tool_conf, tool_path, relative_install_dir) = suc.get_tool_panel_config_tool_path_install_dir(self.app, repository)
    repository.deleted = False
    repository.status = self.install_model.ToolShedRepository.installation_status.INSTALLED
    if repository.includes_tools_for_display_in_tool_panel:
        repository_clone_url = common_util.generate_clone_url_for_installed_repository(self.app, repository)
        tpm = tool_panel_manager.ToolPanelManager(self.app)
        irmm = InstalledRepositoryMetadataManager(app=self.app, tpm=tpm, repository=repository, changeset_revision=repository.changeset_revision, metadata_dict=repository.metadata)
        repository_tools_tups = irmm.get_repository_tools_tups()
        tool_panel_dict = repository.metadata['tool_panel_section']
        tpm.add_to_tool_panel(repository.name, repository_clone_url, repository.installed_changeset_revision, repository_tools_tups, repository.owner, shed_tool_conf, tool_panel_dict, new_install=False)
        if repository.includes_data_managers:
            (tp, data_manager_relative_install_dir) = repository.get_tool_relative_path(self.app)
            data_manager_relative_install_dir = os.path.join(data_manager_relative_install_dir, repository.name)
            dmh = data_manager.DataManagerHandler(self.app)
            dmh.install_data_managers(self.app.config.shed_data_manager_config_file, repository.metadata, repository.get_shed_config_dict(self.app), data_manager_relative_install_dir, repository, repository_tools_tups)
    self.install_model.context.current.add(repository)
    self.install_model.context.current.flush()
    if repository.includes_datatypes:
        if tool_path:
            repository_install_dir = os.path.abspath(os.path.join(tool_path, relative_install_dir))
        else:
            repository_install_dir = os.path.abspath(relative_install_dir)
        cdl = custom_datatype_manager.CustomDatatypeLoader(self.app)
        installed_repository_dict = cdl.load_installed_datatypes(repository, repository_install_dir, deactivate=False)
        if installed_repository_dict:
            converter_path = installed_repository_dict.get('converter_path')
            if (converter_path is not None):
                cdl.load_installed_datatype_converters(installed_repository_dict, deactivate=False)
            display_path = installed_repository_dict.get('display_path')
            if (display_path is not None):
                cdl.load_installed_display_applications(installed_repository_dict, deactivate=False)
