def popleft(self):
        if self.left is self.right and self.leftndx > self.rightndx:
            #raise IndexError, "pop from an empty deque"
            raise IndexError("pop from an empty deque")
        x = self.left[self.leftndx]
        self.left[self.leftndx] = None
        self.length -= 1
        self.leftndx += 1
        self.state += 1
        if self.leftndx == n:
            prevblock = self.left[RGTLNK]
            if prevblock is None:
                # the deque has become empty; recenter instead of freeing block
                self.rightndx = n//2
                self.leftndx = n//2+1
            else:
                prevblock[LFTLNK] = None
                self.left[RGTLNK] = None
                self.left = prevblock
                self.leftndx = 0
        return x
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/_collections.py/deque.popleft/original