class_docstr: Unit tests for writing graphs in the sparse6 format.
  
  Most of the test cases were checked against the sparse6 encoder in Sage.
class_docstr_tok: ["Unit","tests","for","writing","graphs","in","the","sparse6","format",".","Most","of","the","test","cases","were","checked","against","the","sparse6","encoder","in","Sage","."]
code: def test_read_write_inverse(self):
      for i in list(range(13)) + [31, 47, 62, 63, 64, 72]:
          m = min(2 * i, i * i // 2)
          g = nx.random_graphs.gnm_random_graph(i, m, seed=i)
          gstr = BytesIO()
          nx.write_sparse6(g, gstr, header=False)
          # Strip the trailing newline.
          gstr = gstr.getvalue().rstrip()
          g2 = nx.from_sparse6_bytes(gstr)
          assert g2.order() == g.order()
          assert edges_equal(g2.edges(), g.edges())
  
imports: from io import BytesIO
  import pytest
  import networkx
  from networkx.utils import edges_equal, nodes_equal
label_desc: Use image node_id 10 for calling the TestWriteSparse6 obj's underlying member method code with example usage: obj.test_read_write_inverse() without return types