'Invoke a graceful shutdown of the channel with the AMQP Broker.
If channel is OPENING, transition to CLOSING and suppress the incoming
Channel.OpenOk, if any.
:param int reply_code: The reason code to send to broker
:param str reply_text: The reason text to send to broker
:raises ChannelClosed: if channel is already closed
:raises ChannelAlreadyClosing: if channel is already closing'

def close(self, reply_code=0, reply_text='Normal    shutdown'):

    if self.is_closed:
        raise exceptions.ChannelClosed(('Already    closed:    %s' % self))
    if self.is_closing:
        raise exceptions.ChannelAlreadyClosing(('Already    closing:    %s' % self))
    LOGGER.info('Closing    channel    (%s):    %r    on    %s', reply_code, reply_text, self)
    for consumer_tag in dictkeys(self._consumers):
        if (consumer_tag not in self._cancelled):
            self.basic_cancel(consumer_tag=consumer_tag, nowait=True)
    self._set_state(self.CLOSING)
    self._rpc(spec.Channel.Close(reply_code, reply_text, 0, 0), self._on_closeok, [spec.Channel.CloseOk])
