def rotate(self, n=1):
        length = len(self)
        if length == 0:
            return
        halflen = (length+1) >> 1
        if n > halflen or n < -halflen:
            n %= length
            if n > halflen:
                n -= length
            elif n < -halflen:
                n += length
        while n > 0:
            self.appendleft(self.pop())
            n -= 1
        while 0 < n:
            self.append(self.popleft())
            n += 1
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/_collections.py/deque.rotate/swapped operands of `<`