'Declare exchange.'

def exchange_declare(self, exchange=None, type=u'direct', durable=False, auto_delete=False, arguments=None, nowait=False, passive=False):

    type = (type or u'direct')
    exchange = (exchange or (u'amq.%s' % type))
    if passive:
        if (exchange not in self.state.exchanges):
            raise ChannelError(u'NOT_FOUND    -    no    exchange    {0!r}    in    vhost    {1!r}'.format(exchange, (self.connection.client.virtual_host or u'/')), (50, 10), u'Channel.exchange_declare', u'404')
        return
    try:
        prev = self.state.exchanges[exchange]
        if (not self.typeof(exchange).equivalent(prev, exchange, type, durable, auto_delete, arguments)):
            raise NotEquivalentError(NOT_EQUIVALENT_FMT.format(exchange, (self.connection.client.virtual_host or u'/')))
    except KeyError:
        self.state.exchanges[exchange] = {u'type': type, u'durable': durable, u'auto_delete': auto_delete, u'arguments': (arguments or {}), u'table': []}
