def remove(self, widget):
        if isinstance(widget, basestring):
            widget = self.tab_names[widget]
        elif isinstance(widget, int):
            widget = self.getWidget(widget)

        for (k, w) in self.tab_names.items():
            if widget == w:
                self.tab_names.pop(k)
                break

        index = self.getWidgetIndex(widget)
        if index == -1:
            return False

        self.children.remove(widget)
        self.tabBar.removeTab(index)
        self.deck.remove(widget)
        return True
widget to remove can be by integer, a widget in the panel,
dataset/ETHPy150Open pyjs/pyjs/pyjswidgets/pyjamas/ui/TabPanel.py/TabPanel.remove