#NEWLINE# def test_community( self ) : #NEWLINE# #INDENT# for i in range ( self . NUM_NODES ) : #NEWLINE# #INDENT# com_idx = self . cmnties . node_communities_ ( i ) [ 0 ] #NEWLINE# com_obj = self . cmnties . node_communities ( i ) [ 0 ] #NEWLINE# self . assertTrue ( com_idx . has_node_index ( i ) ) #NEWLINE# self . assertTrue ( ( i in com_obj ) ) #NEWLINE# if ( ( i % 2 ) == 1 ) : #NEWLINE# #INDENT# other = ( i - 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# other = ( i + 1 ) #NEWLINE# #UNINDENT# self . assertTrue ( com_idx . has_node_index ( other ) ) #NEWLINE# self . assertTrue ( ( other in com_idx ) ) #NEWLINE# self . assertEqual ( other . community_idx , self . cmnties . node_community_indices_ ( i ) [ 0 ] ) #NEWLINE# self . assertEqual ( com_obj . community_idx , self . cmnties . node_community_indices ( i ) [ 0 ] ) #NEWLINE# self . assertEqual ( len ( com_idx ) , 2 ) #NEWLINE# self . assertEqual ( len ( com_obj ) , 2 )