'Move a tab from a given index to a given index position.'

def move_tab(self, from_index, to_index):

    plugins = self._get_plugins()
    from_plugin = self._get_plugin(from_index)
    to_plugin = self._get_plugin(to_index)
    from_idx = plugins.index(from_plugin)
    to_idx = plugins.index(to_plugin)
    (plugins[from_idx], plugins[to_idx]) = (plugins[to_idx], plugins[from_idx])
    for i in range((len(plugins) - 1)):
        self.main.tabify_plugins(plugins[i], plugins[(i + 1)])
    from_plugin.dockwidget.raise_()
