#NEWLINE# def send( self , **msg ) : #NEWLINE# #INDENT# if ( not isinstance ( msg , str ) ) : #NEWLINE# #INDENT# msg = json . dumps ( msg , cls = NPEncode ) #NEWLINE# #UNINDENT# for sock in self . sockets : #NEWLINE# #INDENT# sock . write_message ( msg ) #NEWLINE# #UNINDENT# return [ json . loads ( self . response . get ( timeout = 2 ) ) for _ in range ( sock . n_clients ) ]