

def get_item(self, name, group=None):
    ' Returns a filter or filter group object.\n\n        :param str name : Name of the selected filter or filter group.\n        :param str group: Name of the group to which the filter belongs. Only\n            valid for filter objects, not for filter groups. If this is None,\n            a top level item is used.\n            Default: None\n        :returns: :class:`Filter` or :class:`FilterGroup`\n        '
    if (not group):
        if (not (name in self.filters)):
            raise KeyError(('No item named "%s" exists!' % str(name)))
        return self.filters[name]
    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 (name in g.filters)):
            raise KeyError(('No item named "%s" exists!' % str(name)))
        return g.filters[name]

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