#NEWLINE# def test_directed_path_collaboration_projected_graph( self ) : #NEWLINE# #INDENT# G = nx . DiGraph ( ) #NEWLINE# G . add_path ( list ( range ( 4 ) ) ) #NEWLINE# P = bipartite . collaboration_weighted_projected_graph ( P , [ 1 , 3 ] ) #NEWLINE# assert_equal ( sorted ( P . nodes ( ) ) , [ 1 , 3 ] ) #NEWLINE# assert_equal ( sorted ( P . edges ( ) ) , [ ( 1 , 3 ) ] ) #NEWLINE# P [ 1 ] [ 3 ] [ 'weight' ] = 1 #NEWLINE# P = bipartite . collaboration_weighted_projected_graph ( G , [ 0 , 2 ] ) #NEWLINE# assert_equal ( sorted ( P . nodes ( ) ) , [ 0 , 2 ] ) #NEWLINE# assert_equal ( sorted ( P . edges ( ) ) , [ ( 0 , 2 ) ] ) #NEWLINE# P [ 0 ] [ 2 ] [ 'weight' ] = 1