code: def test_difference_attributes():
      g = nx.Graph()
      g.add_node(0, x=4)
      g.add_node(1, x=5)
      g.add_edge(0, 1, size=5)
      g.graph["name"] = "g"
  
      h = g.copy()
      h.graph["name"] = "h"
      h.graph["attr"] = "attr"
      h.nodes[0]["x"] = 7
  
      gh = nx.difference(g, h)
      assert set(gh.nodes()) == set(g.nodes())
      assert set(gh.nodes()) == set(h.nodes())
      assert sorted(gh.edges()) == []
      # node and graph data should not be copied over
      assert gh.nodes.data() != g.nodes.data()
      assert gh.graph != g.graph
  
imports: import os
  import pytest
  import networkx
  from networkx.classes.tests import dispatch_interface
  from networkx.utils import edges_equal
label_desc: Use image node_id 10 for calling a global function with example usage: test_difference_attributes() without return types