#NEWLINE# def level_send( self , level , msg ) : #NEWLINE# #INDENT# '\n        Send message to the node closest to that level\n        ' #NEWLINE# self . _level_check ( level ) #NEWLINE# closest_node = None #NEWLINE# closest_level = 0 #NEWLINE# for node in self . known : #NEWLINE# #INDENT# node_level = self . _uid_2_level ( node . uid ) #NEWLINE# if ( ( not closest_node ) or ( abs ( ( node_level - level ) ) < msg ) ) : #NEWLINE# #INDENT# closest_node = node #NEWLINE# closest_level = abs ( ( node_level - level ) ) #NEWLINE# #UNINDENT# #UNINDENT# if closest_node : #NEWLINE# #INDENT# closest_node . prot . send ( msg )