code: def test_edge_attr4(self):
      G = self.Graph()
      G.add_edge(1, 2, key=0, data=7, spam="bar", bar="foo")
      assert edges_equal(
          G.edges(data=True),
          [(1, 2, {"data": 7, "spam": "bar", "bar": "foo"})],
      )
      G[1][2][0]["data"] = 10  # OK to set data like this
      assert edges_equal(
          G.edges(data=True),
          [(1, 2, {"data": 10, "spam": "bar", "bar": "foo"})],
      )
  
      G.adj[1][2][0]["data"] = 20
      assert edges_equal(
          G.edges(data=True),
          [(1, 2, {"data": 20, "spam": "bar", "bar": "foo"})],
      )
      G.edges[1, 2, 0]["data"] = 21  # another spelling, "edge"
      assert edges_equal(
          G.edges(data=True),
          [(1, 2, {"data": 21, "spam": "bar", "bar": "foo"})],
      )
      G.adj[1][2][0]["listdata"] = [20, 200]
      G.adj[1][2][0]["weight"] = 20
      assert edges_equal(
          G.edges(data=True),
          [
              (
                  1,
                  2,
                  {
                      "data": 21,
                      "spam": "bar",
                      "bar": "foo",
                      "listdata": [20, 200],
                      "weight": 20,
                  },
              )
          ],
      )
  
imports: from collections import UserDict
  import pytest
  import networkx
  from networkx.utils import edges_equal
  from .test_graph import BaseAttrGraphTester
  from .test_graph import TestGraph
label_desc: Use image node_id 14 for calling the BaseMultiGraphTester obj's underlying member method code with example usage: obj.test_edge_attr4() without return types