def test_topic_notification_create_maybe(self):
        user = utils.create_user()
        topic = utils.create_topic(self.category)
        comment = utils.create_comment(topic=topic)
        TopicNotification.create_maybe(user=user, comment=comment)
        notification = TopicNotification.objects.get(user=user, topic=topic)
        self.assertTrue(notification.is_active)
        self.assertTrue(notification.is_read)
        self.assertEqual(notification.action, COMMENT)

        # Creating it again should do nothing
        TopicNotification.objects.filter(user=user, topic=topic).update(is_active=False)
        TopicNotification.create_maybe(user=user, comment=comment)
        self.assertFalse(TopicNotification.objects.get(user=user, topic=topic).is_active)
Apply hard local winner-take-all on every rows of a theano matrix.
dataset/ETHPy150Open nitely/Spirit/spirit/topic/notification/tests.py/TopicNotificationModelsTest.test_topic_notification_create_maybe--crossover with--dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/lwta.py/lwta