code: def iter_ising_model(cur):
      
      select = \
          """
          SELECT linear_biases, quadratic_biases, num_nodes, edges, offset
          FROM ising_model, graph
          WHERE graph.id = ising_model.graph_id;
          """
  
      for linear_biases, quadratic_biases, num_nodes, edges, offset in cur.execute(select):
          nodelist = list(range(num_nodes))
          edgelist = json.loads(edges)
          yield (nodelist, edgelist,
                 _decode_linear_biases(linear_biases, nodelist),
                 _decode_quadratic_biases(quadratic_biases, edgelist),
                 offset)
docs: Iterate over all of the Ising models 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 5-tuple consisting of:
  
              list: The nodelist for a graph in the cache.
  
              list: the edgelist for a graph in the cache.
  
              dict: The linear biases of an Ising Model in the cache.
  
              dict: The quadratic biases of an Ising Model in the cache.
  
              float: The constant offset of an Ising Model in the cache.