def get_node_attributes(G, name):
 return {n: d[name] for (n, d) in G.node.items() if (name in d)}

def get_node_attributes ( G , name ) : return { n : d [ name ] for ( n , d ) in G . node . items ( ) if ( name in d ) }
get node attributes from graph parameters g : networkx graph name : string attribute name returns dictionary of attributes keyed by node .