code: def test_to_agraph_with_nodedata(self):
      G = nx.Graph()
      G.add_node(1, color="red")
      A = nx.nx_agraph.to_agraph(G)
      assert dict(A.nodes()[0].attr) == {"color": "red"}
  
imports: import warnings
  import pytest
  import networkx
  from networkx.utils import edges_equal, graphs_equal, nodes_equal
label_desc: Use image node_id 7 for calling the TestAGraph obj's underlying member method code with example usage: obj.test_to_agraph_with_nodedata() without return types