code: def select_embedding_from_source(cur, source_nodelist, source_edgelist,
                                   target_nodelist, target_edgelist):
      
      encoded_data = {'target_num_nodes': len(target_nodelist),
                      'target_num_edges': len(target_edgelist),
                      'target_edges': json.dumps(target_edgelist, separators=(',', ':')),
                      'source_num_nodes': len(source_nodelist),
                      'source_num_edges': len(source_edgelist),
                      'source_edges': json.dumps(source_edgelist, separators=(',', ':'))}
  
      select = \
          """
          SELECT
              source_node,
              chain
          FROM
              embedding_component_view
          WHERE
              source_num_edges = :source_num_edges AND
              source_edges = :source_edges AND
              source_num_nodes = :source_num_nodes AND
  
              target_num_edges = :target_num_edges AND
              target_edges = :target_edges AND
              target_num_nodes = :target_num_nodes
          """
  
      embedding = {v: json.loads(chain) for v, chain in cur.execute(select, encoded_data)}
      return embedding
docs: Select an embedding from the source graph and target graph.
  
      Args:
          cur (:class:`sqlite3.Cursor`):
              An sqlite3 cursor. This function is meant to be run within a :obj:`with` statement.
  
          target_nodelist (list):
              The nodes in the target graph. Should be integer valued.
  
          target_edgelist (list):
              The edges in the target graph.
  
          embedding_tag (str):
              A string tag to associate with the embedding.
  
      Returns:
          dict: The mapping from the source graph to the target graph.
          In the form {v: {s, ...}, ...} where v is a variable in the
          source model and s is a variable in the target model.