@unittest.skipUnless(PROTOCOL_VERSION >= 2, "only runs against the cql3 protocol v2.0")
    def test_insert_if_not_exists(self):

        id = uuid4()

        TestIfNotExistsModel.create(id=id, count=8, text='123456789')

        with self.assertRaises(LWTException) as assertion:
            TestIfNotExistsModel.if_not_exists().create(id=id, count=9, text='111111111111')

        with self.assertRaises(LWTException) as assertion:
            TestIfNotExistsModel.objects(count=9, text='111111111111').if_not_exists().create(id=id)

        self.assertEqual(assertion.exception.existing, {
            'count': 8,
            'id': id,
            'text': '123456789',
            '[applied]': False,
        })

        q = TestIfNotExistsModel.objects(id=id)
        self.assertEqual(len(q), 1)

        tm = q.first()
        self.assertEqual(tm.count, 8)
        self.assertEqual(tm.text, '123456789')
Aux function of GeneralizationAcrossTime
dataset/ETHPy150Open datastax/python-driver/tests/integration/cqlengine/test_ifnotexists.py/IfNotExistsInsertTests.test_insert_if_not_exists--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/decoding/time_gen.py/_check_epochs_input