def deliver(self, message, timeout=None, n=0):
        """Must be used with 'yield' as 'rcvd = yield channel.deliver(message)'.

        Blocking 'send': Wait until message can be delivered to at
        least 'n' subscribers before timeout. Returns number of
        end-point recipients (coroutines) the message is delivered to;
        i.e., in case of heirarchical channels, it is the sum of
        recipients of all the channels.

        Can also be used on remote channels.
        """
        if not isinstance(n, int) or n < 0:
            raise StopIteration(-1)
        if self._location == Channel._asyncoro._location:
            if self._transform:
                try:
                    message = self._transform(self._name, message)
                except:
                    message = None
                if message is None:
                    raise StopIteration(0)
            if n:
                while len(self._subscribers) < n:
                    start = _time()
                    self._subscribe_event.clear()
                    if (yield self._subscribe_event.wait(timeout)) is False:
                        raise StopIteration(0)
                    if timeout is not None:
                        timeout -= _time() - start
                        if timeout <= 0:
                            raise StopIteration(0)
            # during delivery, _subscribers may change, so make copy
            subscribers = list(self._subscribers)
            info = {'reply': 0, 'pending': len(subscribers), 'success': 0,
                    'done': Event(), 'invalid': []}

            def _deliver(subscriber, info, timeout, n, coro=None):
                try:
                    reply = yield subscriber.deliver(message, timeout=timeout)
                    if reply > 0:
                        info['reply'] += reply
                        info['success'] += 1
                        if n > 0 and info['success'] >= n:
                            info['done'].set()
                    elif reply < 0:
                        info['invalid'].append(subscriber)
                except:
                    pass
                info['pending'] -= 1
                if info['pending'] == 0:
                    info['done'].set()
            for subscriber in subscribers:
                if isinstance(subscriber, Coro) and self._location == subscriber._location:
                    if subscriber.send(message) == 0:
                        info['reply'] += 1
                        info['success'] += 1
                    info['pending'] -= 1
                else:
                    # channel/remote coro
                    Coro(_deliver, subscriber, info, timeout, n)
            if info['pending'] == 0:
                info['done'].set()
            if n == 0 or n < info['success']:
                yield info['done'].wait(timeout)

            if info['invalid']:
                def _unsub(self, subscriber, coro=None):
                    logger.debug('remote subscriber %s is not valid; unsubscribing it', subscriber)
                    yield self.unsubscribe(subscriber)
                for subscriber in info['invalid']:
                    Coro(_unsub, self, subscriber)

            raise StopIteration(info['reply'])
        else:
            # remote channel
            request = _NetRequest('deliver', kwargs={'channel': self._name, 'message': message,
                                                     'n': n},
                                  dst=self._location, timeout=timeout)
            request.reply = -1
            reply = yield Channel._asyncoro._sync_reply(request, alarm_value=0)
            if reply is None:
                reply = -1
            # if reply < 0:
            #     logger.warning('remote channel "%s" at %s may have gone away!',
            #                    self._name, self._location)
            raise StopIteration(reply)
dataset/ETHPy150Open pgiri/asyncoro/py2/asyncoro/__init__.py/Channel.deliver/swapped operands of `<`