#NEWLINE# def publish( self , msg ) : #NEWLINE# #INDENT# ' Publish a message using this publisher.\n\n        Keyword arguments:\n        msg -- the dict (json) message to publish\n\n        Throws:\n        Exception -- propagates exceptions from message conversion if the\n        provided msg does not properly conform to the message type of this\n        publisher\n\n        ' #NEWLINE# if ( self . listener . attached and self . listener . timed_out ( ) ) : #NEWLINE# #INDENT# self . listener . detach ( ) #NEWLINE# #UNINDENT# inst = self . msg_class ( ) #NEWLINE# message_conversion . populate_instance ( msg , inst ) #NEWLINE# self . publisher . publish ( msg )