/usr/lib/python2.7/dist-packages/dipy/core/tests/test_graph.py is in python-dipy 0.10.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | from dipy.core.graph import Graph
from nose.tools import assert_equal
def test_graph():
g=Graph()
g.add_node('a',5)
g.add_node('b',6)
g.add_node('c',10)
g.add_node('d',11)
g.add_edge('a','b')
g.add_edge('b','c')
g.add_edge('c','d')
g.add_edge('b','d')
print('Nodes')
print(g.node)
print('Successors')
print(g.succ)
print('Predecessors')
print(g.pred)
print('Paths above d')
print(g.up('d'))
print('Paths below a')
print(g.down('a'))
print('Shortest path above d')
print(g.up_short('d'))
print('Shortest path below a')
print(g.down_short('a'))
print( 'Deleting node b')
#g.del_node_and_edges('b')
g.del_node('b')
print( 'Nodes')
print( g.node)
print( 'Successors')
print( g.succ)
print( 'Predecessors')
print( g.pred)
assert_equal(len(g.node),3)
assert_equal(len(g.succ),3)
assert_equal(len(g.pred),3)
|