

def _get_next_channel_id(self):
    if (len(self.channels) == 65536):
        raise AmqpError('max channels per connection exceeded')
    next_id = self.last_channel_id
    while True:
        next_id = ((next_id + 1) % 65536)
        if (next_id not in self.channels):
            break
    self.last_channel_id = next_id
    return self

dataset/ETHPy150Open paolo-losi/stormed-amqp/stormed/connection.py Connection._get_next_channel_id/VarMisuse@77/114 `next_id`->`self`