

def remove_item(self, item, group=None):
    ' Removes an item from the filter tree.\n\n        :param str item: Name of the item to be removed.\n        :param str group: Name of the group to which the item belongs.\n            If this is None, a top level item will be removed.\n            Default: None\n        '
    if (not group):
        if (not (item in self.filters)):
            raise KeyError(('No item named "%s" exists!' % str(item)))
        self.filters.pop(item)
    else:
        if (not (group in self.filters)):
            raise KeyError(('No group named "%s" exists!' % str(group)))
        g = self.filters[group]
        if (not isinstance(g, self.FilterGroup)):
            raise TypeError(('Item "%s" is not a filter group!' % str(group)))
        if (not (item in g.filters)):
            raise KeyError(('No item named "%s" exists!' % str(item)))
        g.filters.pop(item)

dataset/ETHPy150Open rproepp/spykeviewer/spykeviewer/plugin_framework/filter_manager.py FilterManager.remove_item/original