'Uninstall plugins. Pass an instance to remove a specific plugin, a type
object to remove all plugins that match that type, a string to remove
all plugins with a matching ``name`` attribute or ``True`` to remove all
plugins. Return the list of removed plugins.'

def uninstall(self, plugin):

    (removed, remove) = ([], plugin)
    for (i, plugin) in list(enumerate(self.plugins))[::(-1)]:
        if ((remove is True) or (remove is plugin) or (remove is type(plugin)) or (getattr(plugin, 'name', True) == remove)):
            removed.append(plugin)
            del self.plugins[i]
            if hasattr(plugin, 'close'):
                plugin.close()
    if removed:
        self.reset()
    return removed
