#NEWLINE# def test_florentine_families_graph( self ) : #NEWLINE# #INDENT# 'Weighted betweenness centrality: \n        Florentine families graph' #NEWLINE# G = nx . florentine_families_graph ( ) #NEWLINE# b_answer = { #NEWLINE# #INDENT# 'Acciaiuoli' : 0.0 , #NEWLINE# 'Albizzi' : 0.212 , #NEWLINE# 'Barbadori' : 0.093 , #NEWLINE# 'Bischeri' : 0.104 , #NEWLINE# 'Castellani' : 0.055 , #NEWLINE# 'Ginori' : 0.0 , #NEWLINE# 'Guadagni' : 0.255 , #NEWLINE# 'Lamberteschi' : 0.0 , #NEWLINE# 'Medici' : 0.522 , #NEWLINE# 'Pazzi' : 0.0 , #NEWLINE# 'Peruzzi' : 0.022 , #NEWLINE# 'Ridolfi' : 0.114 , #NEWLINE# 'Salviati' : 0.143 , #NEWLINE# 'Strozzi' : 0.103 , #NEWLINE# 'Tornabuoni' : 0.092 , #NEWLINE# #UNINDENT# } #NEWLINE# b = nx . betweenness_centrality ( G , weight = 'weight' , normalized = True ) #NEWLINE# for n in sorted ( G ) : #NEWLINE# #INDENT# assert_almost_equal ( b [ n ] , b_answer [ n ] , places = 3 )