code: def test_graph(self):
      g = nx.cycle_graph(10)
      G = nx.Graph()
      G.add_nodes_from(g)
      G.add_weighted_edges_from((u, v, u) for u, v in g.edges())
  
      # Dict of dicts
      dod = to_dict_of_dicts(G)
      GG = from_dict_of_dicts(dod, create_using=nx.Graph)
      assert nodes_equal(sorted(G.nodes()), sorted(GG.nodes()))
      assert edges_equal(sorted(G.edges()), sorted(GG.edges()))
      GW = to_networkx_graph(dod, create_using=nx.Graph)
      assert nodes_equal(sorted(G.nodes()), sorted(GW.nodes()))
      assert edges_equal(sorted(G.edges()), sorted(GW.edges()))
      GI = nx.Graph(dod)
      assert sorted(G.nodes()) == sorted(GI.nodes())
      assert sorted(G.edges()) == sorted(GI.edges())
  
      # Dict of lists
      dol = to_dict_of_lists(G)
      GG = from_dict_of_lists(dol, create_using=nx.Graph)
      # dict of lists throws away edge data so set it to none
      enone = [(u, v, {}) for (u, v, d) in G.edges(data=True)]
      assert nodes_equal(sorted(G.nodes()), sorted(GG.nodes()))
      assert edges_equal(enone, sorted(GG.edges(data=True)))
      GW = to_networkx_graph(dol, create_using=nx.Graph)
      assert nodes_equal(sorted(G.nodes()), sorted(GW.nodes()))
      assert edges_equal(enone, sorted(GW.edges(data=True)))
      GI = nx.Graph(dol)
      assert nodes_equal(sorted(G.nodes()), sorted(GI.nodes()))
      assert edges_equal(enone, sorted(GI.edges(data=True)))
  
imports: import pytest
  import networkx
  from networkx.convert import from_dict_of_dicts, from_dict_of_lists, to_dict_of_dicts, to_dict_of_lists, to_networkx_graph
  from networkx.generators.classic import barbell_graph, cycle_graph
  from networkx.utils import edges_equal, graphs_equal, nodes_equal
label_desc: Use image node_id 5 for calling the TestConvert obj's underlying member method code with example usage: obj.test_graph() without return types