code: def test_agraph_roundtripping(self, G, tmp_path):
      G = self.build_graph(G)
      A = nx.nx_agraph.to_agraph(G)
      H = nx.nx_agraph.from_agraph(A)
      self.assert_equal(G, H)
  
      fname = tmp_path / "test.dot"
      nx.drawing.nx_agraph.write_dot(H, fname)
      Hin = nx.nx_agraph.read_dot(fname)
      self.assert_equal(H, Hin)
  
      fname = tmp_path / "fh_test.dot"
      with open(fname, "w") as fh:
          nx.drawing.nx_agraph.write_dot(H, fh)
  
      with open(fname) as fh:
          Hin = nx.nx_agraph.read_dot(fh)
      self.assert_equal(H, Hin)
  
imports: import warnings
  import pytest
  import networkx
  from networkx.utils import edges_equal, graphs_equal, nodes_equal
label_desc: Use image node_id 3 for calling the TestAGraph obj's underlying member method code with example usage: obj.test_agraph_roundtripping(G, tmp_path) without return types