code: def get_node_attributes(G, name, default=None):
      """Get node attributes from graph
  
      Parameters
      ----------
      G : NetworkX Graph
  
      name : string
         Attribute name
  
      default: object (default=None)
         Default value of the node attribute if there is no value set for that
         node in graph. If `None` then nodes without this attribute are not
         included in the returned dict.
  
      Returns
      -------
      Dictionary of attributes keyed by node.
  
      Examples
      --------
      >>> G = nx.Graph()
      >>> G.add_nodes_from([1, 2, 3], color="red")
      >>> color = nx.get_node_attributes(G, "color")
      >>> color[1]
      'red'
      >>> G.add_node(4)
      >>> color = nx.get_node_attributes(G, "color", default="yellow")
      >>> color[4]
      'yellow'
      """
      if default is not None:
          return {n: d.get(name, default) for n, d in G.nodes.items()}
      return {n: d[name] for n, d in G.nodes.items() if name in d}
  
imports: from collections import Counter
  from itertools import chain
  import networkx
  from networkx.utils import not_implemented_for, pairwise
label_desc: Use image node_id 24 for calling a global function with example usage: get_node_attributes(G, name, default) and returns: unknown, unknown