def test_for_image ( self , cat , img ) : return self . test_for_category ( cat ) and img in self . items [ cat ]
check if item is in series python
Tests if image img in category cat exists
def test_for_image(self, cat, img):
        """Tests if image img in category cat exists"""
        return self.test_for_category(cat) and img in self.items[cat]