def _check_send(self):
        if self._max < self._active:
            return

        while self._active >= self._max:
            first_q = min(self._queues.itervalues(), key=self._key_getter)
            key = first_q[2]
            second_q = min((q for (k, q) in self._queues.iteritems()
                            if k != key), key=self._key_getter)

            switch_grpos = second_q[0]
            frame_queue = first_q[1]
            while frame_queue:
                if frame_queue[0][0] > switch_grpos:
                    break
                (grpos, frame) = frame_queue.popleft()
                self._callback(grpos, key, frame)

            if not frame_queue:
                self._active -= 1
            else:
                first_q[0] = frame_queue[0][0]
dataset/ETHPy150Open arkadini/twimp/twimp/utils.py/FrameSorter._check_send/swapped operands of `<`