'Initiate graceful closing of channels that are in OPEN or OPENING
states, passing reply_code and reply_text.
:param int reply_code: The code for why the channels are being closed
:param str reply_text: The text reason for why the channels are closing'

def _close_channels(self, reply_code, reply_text):

    assert self.is_open, str(self)
    for channel_number in dictkeys(self._channels):
        chan = self._channels[channel_number]
        if (not (chan.is_closing or chan.is_closed)):
            chan.close(reply_code, reply_text)
