#NEWLINE# def test_davis_betweenness_centrality( self ) : #NEWLINE# #INDENT# G = self . davis #NEWLINE# bet = bipartite . betweenness_centrality ( G , answer . top_nodes ) #NEWLINE# answer = { #NEWLINE# #INDENT# 'E8' : 0.24 , #NEWLINE# 'E9' : 0.23 , #NEWLINE# 'E7' : 0.13 , #NEWLINE# 'Nora Fayette' : 0.11 , #NEWLINE# 'Evelyn Jefferson' : 0.1 , #NEWLINE# 'Theresa Anderson' : 0.09 , #NEWLINE# 'E6' : 0.07 , #NEWLINE# 'Sylvia Avondale' : 0.07 , #NEWLINE# 'Laura Mandeville' : 0.05 , #NEWLINE# 'Brenda Rogers' : 0.05 , #NEWLINE# 'Katherina Rogers' : 0.05 , #NEWLINE# 'E5' : 0.04 , #NEWLINE# 'Helen Lloyd' : 0.04 , #NEWLINE# 'E3' : 0.02 , #NEWLINE# 'Ruth DeSand' : 0.02 , #NEWLINE# 'Verne Sanderson' : 0.02 , #NEWLINE# 'E12' : 0.02 , #NEWLINE# 'Myra Liddel' : 0.02 , #NEWLINE# 'E11' : 0.02 , #NEWLINE# 'Eleanor Nye' : 0.01 , #NEWLINE# 'Frances Anderson' : 0.01 , #NEWLINE# 'Pearl Oglethorpe' : 0.01 , #NEWLINE# 'E4' : 0.01 , #NEWLINE# 'Charlotte McDowd' : 0.01 , #NEWLINE# 'E10' : 0.01 , #NEWLINE# 'Olivia Carleton' : 0.01 , #NEWLINE# 'Flora Price' : 0.01 , #NEWLINE# 'E2' : 0.0 , #NEWLINE# 'E1' : 0.0 , #NEWLINE# 'Dorothy Murchison' : 0.0 , #NEWLINE# 'E13' : 0.0 , #NEWLINE# 'E14' : 0.0 , #NEWLINE# #UNINDENT# } #NEWLINE# for ( node , value ) in answer . items ( ) : #NEWLINE# #INDENT# assert_almost_equal ( value , bet [ node ] , places = 2 )