code: def test_edge_attributes():
      """Tests that node contraction preserves edge attributes."""
      # Shape: src1 --> dest <-- src2
      G = nx.DiGraph([("src1", "dest"), ("src2", "dest")])
      G["src1"]["dest"]["value"] = "src1-->dest"
      G["src2"]["dest"]["value"] = "src2-->dest"
      H = nx.MultiDiGraph(G)
  
      G = nx.contracted_nodes(
          G, "src1", "src2"
      )  # New Shape: src1 --> dest
      assert G.edges[("src1", "dest")]["value"] == "src1-->dest"
      assert (
          G.edges[("src1", "dest")]["contraction"][("src2", "dest")][
              "value"
          ]
          == "src2-->dest"
      )
  
      H = nx.contracted_nodes(
          H, "src1", "src2"
      )  # New Shape: src1 -(x2)-> dest
      assert len(H.edges(("src1", "dest"))) == 2
  
imports: import pytest
  import networkx
  from networkx.utils import arbitrary_element, edges_equal, nodes_equal
label_desc: Use image node_id 26 for calling a global function with example usage: test_edge_attributes() without return types