

def filter(self, filtered=None, **kwargs):
    'Returns objects in this container whose attributes match the given\n        keyword arguments.\n        '
    if (filtered is None):
        filtered = self._objects
    try:
        (key, value) = kwargs.popitem()
    except KeyError:
        return filtered

    def get_match(obj):
        return (hasattr(obj, key) and (getattr(obj, key) == value))
    return self.filter(filtered=filter(get_match, filtered), **kwargs)

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/test/test_data/utils.py TestDataContainer.filter/original