#NEWLINE# def test_bipartite_weighted_degrees( self ) : #NEWLINE# #INDENT# G = nx . path_graph ( 5 ) #NEWLINE# G . add_edge ( 0 , 1 , weight = 0.1 , other = 0.2 ) #NEWLINE# X = set ( [ 1 , 3 ] ) #NEWLINE# Y = set ( [ 0 , 2 , 4 ] ) #NEWLINE# ( u , d ) = bipartite . degrees ( G , Y , weight = 'weight' ) #NEWLINE# assert_equal ( u , { #NEWLINE# #INDENT# 1 : 1.1 , #NEWLINE# 3 : 2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert_equal ( d , { #NEWLINE# #INDENT# 0 : 0.1 , #NEWLINE# 2 : 2 , #NEWLINE# 4 : 1 , #NEWLINE# #UNINDENT# } ) #NEWLINE# ( u , d ) = bipartite . degrees ( G , Y , weight = 'other' ) #NEWLINE# assert_equal ( u , { #NEWLINE# #INDENT# 1 : 1.2 , #NEWLINE# 3 : 2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert_equal ( d , { #NEWLINE# #INDENT# 0 : 0.2 , #NEWLINE# 2 : 2 , #NEWLINE# 4 : 1 , #NEWLINE# #UNINDENT# } )