code: def get_node_attributes(G, name):
      
      return {n: d[name] for n, d in G.node.items() if name in d}
docs: Get node attributes from graph
  
          Parameters
          ----------
          G : DyNetx Graph
  
          name : string
             Attribute name
  
          Returns
          -------
          Dictionary of attributes keyed by node.