<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , unicode_literals <EOL> from kombu . five import Queue , values <EOL> from . import virtual <EOL> class Channel ( virtual . Channel ) : <EOL> queues = { } <EOL> do_restore = False <EOL> supports_fanout = True <EOL> def _has_queue ( self , queue , ** kwargs ) : <EOL> return queue in self . queues <EOL> def _new_queue ( self , queue , ** kwargs ) : <EOL> if queue not in self . queues : <EOL> self . queues [ queue ] = Queue ( ) <EOL> def _get ( self , queue , timeout = None ) : <EOL> return self . _queue_for ( queue ) . get ( block = False ) <EOL> def _queue_for ( self , queue ) : <EOL> if queue not in self . queues : <EOL> self . queues [ queue ] = Queue ( ) <EOL> return self . queues [ queue ] <EOL> def _queue_bind ( self , * args ) : <EOL> pass <EOL> def _put_fanout ( self , exchange , message , routing_key = None , ** kwargs ) : <EOL> for queue in self . _lookup ( exchange , routing_key ) : <EOL> self . _queue_for ( queue ) . put ( message ) <EOL> def _put ( self , queue , message , ** kwargs ) : <EOL> self . _queue_for ( queue ) . put ( message ) <EOL> def _size ( self , queue ) : <EOL> return self . _queue_for ( queue ) . qsize ( ) <EOL> def _delete ( self , queue , * args , ** kwargs ) : <EOL> self . queues . pop ( queue , None ) <EOL> def _purge ( self , queue ) : <EOL> q = self . _queue_for ( queue ) <EOL> size = q . qsize ( ) <EOL> q . queue . clear ( ) <EOL> return size <EOL> def close ( self ) : <EOL> super ( Channel , self ) . close ( ) <EOL> for queue in values ( self . queues ) : <EOL> queue . empty ( ) <EOL> self . queues = { } <EOL> def after_reply_message_received ( self , queue ) : <EOL> pass <EOL> class Transport ( virtual . Transport ) : <EOL> Channel = Channel <EOL> state = virtual . BrokerState ( ) <EOL> driver_type = '<STR_LIT>' <EOL> driver_name = '<STR_LIT>' <EOL> def driver_version ( self ) : <EOL> return '<STR_LIT>' </s>
