class_docstr: Unit tests for :func:`networkx.generators.lattice.grid_graph`
docstr: grid_graph([n,m]) is a connected simple graph with the
  following properties:
  number_of_nodes = n*m
  degree_histogram = [0,0,4,2*(n+m)-8,(n-2)*(m-2)]
docstr_tok: ["grid_graph","(","[","n",",","m","]",")","is","a","connected","simple","graph","with","the","following","properties",":","number_of_nodes","=","n","*","m","degree_histogram","=","[","0,0,4,2","*","(","n+m",")","-8",",","(","n-2",")","*","(","m-2",")","]"]
code: def test_grid_graph(self):
      """grid_graph([n,m]) is a connected simple graph with the
      following properties:
      number_of_nodes = n*m
      degree_histogram = [0,0,4,2*(n+m)-8,(n-2)*(m-2)]
      """
      for n, m in [(3, 5), (5, 3), (4, 5), (5, 4)]:
          dim = [n, m]
          g = nx.grid_graph(dim)
          assert len(g) == n * m
          assert nx.degree_histogram(g) == [
              0,
              0,
              4,
              2 * (n + m) - 8,
              (n - 2) * (m - 2),
          ]
  
      for n, m in [(1, 5), (5, 1)]:
          dim = [n, m]
          g = nx.grid_graph(dim)
          assert len(g) == n * m
          assert nx.is_isomorphic(g, nx.path_graph(5))
  
imports: from itertools import product
  import pytest
  import networkx
  from networkx.utils import edges_equal
label_desc: Use image node_id 1 for calling the TestGridGraph obj's underlying member method code with example usage: obj.test_grid_graph() without return types