code: def get_edge_attributes(G, name, default=None):
      """Get edge attributes from graph
  
      Parameters
      ----------
      G : NetworkX Graph
  
      name : string
         Attribute name
  
      default: object (default=None)
         Default value of the edge attribute if there is no value set for that
         edge in graph. If `None` then edges without this attribute are not
         included in the returned dict.
  
      Returns
      -------
      Dictionary of attributes keyed by edge. For (di)graphs, the keys are
      2-tuples of the form: (u, v). For multi(di)graphs, the keys are 3-tuples of
      the form: (u, v, key).
  
      Examples
      --------
      >>> G = nx.Graph()
      >>> nx.add_path(G, [1, 2, 3], color="red")
      >>> color = nx.get_edge_attributes(G, "color")
      >>> color[(1, 2)]
      'red'
      >>> G.add_edge(3, 4)
      >>> color = nx.get_edge_attributes(G, "color", default="yellow")
      >>> color[(3, 4)]
      'yellow'
      """
      if G.is_multigraph():
          edges = G.edges(keys=True, data=True)
      else:
          edges = G.edges(data=True)
      if default is not None:
          return {x[:-1]: x[-1].get(name, default) for x in edges}
      return {x[:-1]: x[-1][name] for x in edges if name in x[-1]}
  
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 26 for calling a global function with example usage: get_edge_attributes(G, name, default) and returns: unknown, unknown