code: def iter_graph(cur):
      
      select = """SELECT num_nodes, num_edges, edges from graph;"""
      for num_nodes, num_edges, edges in cur.execute(select):
          yield list(range(num_nodes)), json.loads(edges)
docs: Iterate over all graphs in the cache.
  
      Args:
          cur (:class:`sqlite3.Cursor`): An sqlite3 cursor. This function
              is meant to be run within a :obj:`with` statement.
  
      Yields:
          tuple: A 2-tuple containing:
  
              list: The nodelist for a graph in the cache.
  
              list: the edgelist for a graph in the cache.
  
      Examples:
          >>> nodelist = [0, 1, 2]
          >>> edgelist = [(0, 1), (1, 2)]
          >>> with pmc.cache_connect(':memory:') as cur:
          ...     pmc.insert_graph(cur, nodelist, edgelist)
          ...     list(pmc.iter_graph(cur))
          [([0, 1, 2], [[0, 1], [1, 2]])]