class_docstr: Unit tests for :func:`networkx.generators.lattice.grid_2d_graph`
code: def test_periodic(self):
      G = nx.grid_2d_graph(0, 0, periodic=True)
      assert dict(G.degree()) == {}
  
      for m, n, H in [
          (2, 2, nx.cycle_graph(4)),
          (1, 7, nx.cycle_graph(7)),
          (7, 1, nx.cycle_graph(7)),
          (2, 5, nx.circular_ladder_graph(5)),
          (5, 2, nx.circular_ladder_graph(5)),
          (2, 4, nx.cubical_graph()),
          (4, 2, nx.cubical_graph()),
      ]:
          G = nx.grid_2d_graph(m, n, periodic=True)
          assert nx.could_be_isomorphic(G, H)
  
imports: from itertools import product
  import pytest
  import networkx
  from networkx.utils import edges_equal
label_desc: Use image node_id 5 for calling the TestGrid2DGraph obj's underlying member method code with example usage: obj.test_periodic() without return types