#NEWLINE# def publish( self , body , exchange = None , routing_key = None , mandatory = False , immediate = False , content_type = None , content_encoding = None , serializer = None , headers = None , compression = None , retry = False , retry_policy = None , declare = [ ] , **properties ) : #NEWLINE# #INDENT# assert self . channel #NEWLINE# content_type = ( content_type or self . content_type ) #NEWLINE# properties = pika . BasicProperties ( content_type = content_type ) #NEWLINE# self . channel . basic_publish ( exchange = exchange , routing_key = routing_key , body = body , properties = properties , mandatory = mandatory , immediate = immediate )