python networkx directed graph