def pop(self):
        if self._pending_removals:
            self._commit_removals()
        while True:
            try:
                itemref = self.data.pop()
            except __HOLE__:
                raise KeyError('pop from empty WeakSet')
            item = itemref()
            if item is not None:
                return item
dataset/ETHPy150Open datastax/python-driver/cassandra/util.py/WeakSet.pop