code: def margulis_gabber_galil_graph(n, create_using=None):
      r"""Returns the Margulis-Gabber-Galil undirected MultiGraph on `n^2` nodes.
  
      The undirected MultiGraph is regular with degree `8`. Nodes are integer
      pairs. The second-largest eigenvalue of the adjacency matrix of the graph
      is at most `5 \sqrt{2}`, regardless of `n`.
  
      Parameters
      ----------
      n : int
          Determines the number of nodes in the graph: `n^2`.
      create_using : NetworkX graph constructor, optional (default MultiGraph)
         Graph type to create. If graph instance, then cleared before populated.
  
      Returns
      -------
      G : graph
          The constructed undirected multigraph.
  
      Raises
      ------
      NetworkXError
          If the graph is directed or not a multigraph.
  
      """
      G = nx.empty_graph(0, create_using, default=nx.MultiGraph)
      if G.is_directed() or not G.is_multigraph():
          msg = "`create_using` must be an undirected multigraph."
          raise nx.NetworkXError(msg)
  
      for x, y in itertools.product(range(n), repeat=2):
          for u, v in (
              ((x + 2 * y) % n, y),
              ((x + (2 * y + 1)) % n, y),
              (x, (y + 2 * x) % n),
              (x, (y + (2 * x + 1)) % n),
          ):
              G.add_edge((x, y), (u, v))
      G.graph["name"] = f"margulis_gabber_galil_graph({n})"
      return G
  
file_path: networkx/networkx/generators/expanders.py
imports: import itertools
  import networkx
label_desc: Use image node_id 1 for calling a global function with example usage: margulis_gabber_galil_graph(n, create_using) and returns: G