code: def cancel(self, consumer_tag=''):
          
          if not compatibility.is_string(consumer_tag):
              raise AMQPInvalidArgument('consumer_tag should be a string')
          cancel_frame = specification.Basic.Cancel(consumer_tag=consumer_tag)
          result = self._channel.rpc_request(cancel_frame)
          self._channel.remove_consumer_tag(consumer_tag)
          return result
docs: Cancel a queue consumer.
  
          :param str consumer_tag: Consumer tag
  
          :raises AMQPInvalidArgument: Invalid Parameters
          :raises AMQPChannelError: Raises if the channel encountered an error.
          :raises AMQPConnectionError: Raises if the connection
                                       encountered an error.
  
          :rtype: dict