def basic_consume(self, consumer_callback,
                      queue='',
                      no_ack=False,
                      exclusive=False,
                      consumer_tag=None,
                      arguments=None):
        """Sends the AMQP command Basic.Consume to the broker and binds messages
        for the consumer_tag to the consumer callback. If you do not pass in
        a consumer_tag, one will be automatically generated for you. Returns
        the consumer tag.

        For more information on basic_consume, see:
        http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.consume

        :param callable consumer_callback: The function to call when consuming
            with the signature consumer_callback(channel, method, properties,
                                                 body), where
                                channel: pika.Channel
                                method: pika.spec.Basic.Deliver
                                properties: pika.spec.BasicProperties
                                body: str, unicode, or bytes (python 3.x)

        :param queue: The queue to consume from
        :type queue: str or unicode
        :param bool no_ack: Tell the broker to not expect a response
        :param bool exclusive: Don't allow other consumers on the queue
        :param consumer_tag: Specify your own consumer tag
        :type consumer_tag: str or unicode
        :param dict arguments: Custom key/value pair arguments for the consume
        :rtype: str

        """
        self._validate_channel_and_callback(consumer_callback)

        # If a consumer tag was not passed, create one
        if not consumer_tag:
            consumer_tag = self._generate_consumer_tag()

        if consumer_tag in self._consumers or self._cancelled in consumer_tag:
            raise exceptions.DuplicateConsumerTag(consumer_tag)

        if no_ack:
            self._consumers_with_noack.add(consumer_tag)

        self._consumers[consumer_tag] = consumer_callback
        self._rpc(spec.Basic.Consume(queue=queue,
                                     consumer_tag=consumer_tag,
                                     no_ack=no_ack,
                                     exclusive=exclusive,
                                     arguments=arguments or dict()),
                  self._on_eventok, [(spec.Basic.ConsumeOk,
                                      {'consumer_tag': consumer_tag})])

        return consumer_tag
dataset/ETHPy150Open pika/pika/pika/channel.py/Channel.basic_consume/swapped operands of `in`