#NEWLINE# def test_betweenness_centrality( self ) : #NEWLINE# #INDENT# c = bipartite . betweenness_centrality ( self . P4 , [ 1 , 3 ] ) #NEWLINE# answer = { #NEWLINE# #INDENT# 0 : 0.0 , #NEWLINE# 1 : 1.0 , #NEWLINE# 2 : 1.0 , #NEWLINE# 3 : 0.0 , #NEWLINE# #UNINDENT# } #NEWLINE# assert_equal ( c , answer ) #NEWLINE# c = bipartite . betweenness_centrality ( self . K3 , [ 0 , 1 , 2 ] ) #NEWLINE# answer = { #NEWLINE# #INDENT# 0 : 0.125 , #NEWLINE# 1 : 0.125 , #NEWLINE# 2 : 0.125 , #NEWLINE# 3 : 0.125 , #NEWLINE# 4 : 0.125 , #NEWLINE# 5 : 0.125 , #NEWLINE# #UNINDENT# } #NEWLINE# assert_equal ( c , answer ) #NEWLINE# c = bipartite . betweenness_centrality ( self . C4 , [ 0 , 2 ] ) #NEWLINE# answer = { #NEWLINE# #INDENT# 0 : 0.25 , #NEWLINE# 1 : 0.25 , #NEWLINE# 2 : 0.25 , #NEWLINE# 3 : 0.25 , #NEWLINE# #UNINDENT# } #NEWLINE# assert_equal ( c , answer )