code: def test_default_attribute(self):
      G = nx.Graph(name="Fred")
      G.add_node(1, label=1, color="green")
      nx.add_path(G, [0, 1, 2, 3])
      G.add_edge(1, 2, weight=3)
      G.graph["node_default"] = {"color": "yellow"}
      G.graph["edge_default"] = {"weight": 7}
      fh = io.BytesIO()
      self.writer(G, fh)
      fh.seek(0)
      H = nx.read_graphml(fh, node_type=int)
      assert nodes_equal(G.nodes(), H.nodes())
      assert edges_equal(G.edges(), H.edges())
      assert G.graph == H.graph
  
imports: import io
  import pytest
  import networkx
  from networkx.readwrite.graphml import GraphMLWriter
  from networkx.utils import edges_equal, nodes_equal
label_desc: Use image node_id 9 for calling the TestWriteGraphML obj's underlying member method code with example usage: obj.test_default_attribute() without return types