class_docstr: Unit tests for :func:`networkx.generators.lattice.grid_2d_graph`
code: def test_periodic_iterable(self):
      m, n = 3, 7
      for a, b in product([0, 1], [0, 1]):
          G = nx.grid_2d_graph(m, n, periodic=(a, b))
          assert G.number_of_nodes() == m * n
          assert (
              G.number_of_edges() == (m + a - 1) * n + (n + b - 1) * m
          )
  
imports: from itertools import product
  import pytest
  import networkx
  from networkx.utils import edges_equal
label_desc: Use image node_id 6 for calling the TestGrid2DGraph obj's underlying member method code with example usage: obj.test_periodic_iterable() without return types