def test_remove_range(self):
        sl = self.skiplist()
        self.assertEqual(sl.remove_range(0, 3), 0)
        sl.insert(1, 'bla')
        self.assertEqual(sl.remove_range(0, 3), 1)
        sl = self.random(10)
        li = list(sl)
        lir = li[:4] + li[7:]
        self.assertEqual(sl.remove_range(4, 7), 3)
        li2 = list(sl)
        self.assertEqual(li2, lir)
        #
        sl = self.random()
        li = list(sl)
        lir = li[:5] + li[-8:]
        self.assertEqual(sl.remove_range(5, -8), len(li[5:-8]))
        li2 = list(sl)
        self.assertEqual(li2, lir)
        #
        sl = self.random()
        c = 0
        while sl:
            c += 1
            index = randint(0, len(sl)-1)
            self.assertEqual(sl.remove_range(index, index+1), 1)
        self.assertEqual(c, 100)
dataset/ETHPy150Open quantmind/pulsar/tests/utils/structures/test_skiplist.py/TestSkiplist.test_remove_range/original