'Create a new channel with the next available channel number or pass
in a channel number to use. Must be non-zero if you would like to
specify but it is recommended that you let Pika manage the channel
numbers.
:param method on_open_callback: The callback when the channel is opened
:param int channel_number: The channel number to use, defaults to the
next available.
:rtype: pika.channel.Channel'

def channel(self, on_open_callback, channel_number=None):

    if (not self.is_open):
        raise exceptions.ConnectionClosed(('Channel    allocation    requires    an    open    connection:    %s' % self))
    if (not channel_number):
        channel_number = self._next_channel_number()
    self._channels[channel_number] = self._create_channel(channel_number, on_open_callback)
    self._add_channel_callbacks(channel_number)
    self._channels[channel_number].open()
    return self._channels[channel_number]
