<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def select_embedding_from_tag(cur, embedding_tag, target_nodelist, target_edgelist):
 """Select an embedding from the given tag and target graph. Args: cur (:class:`sqlite3.Cursor`):
 An sqlite3 cursor. This function is meant to be run within a :obj:`with` statement. source_nodelist (list):
 The nodes in the source graph. Should be integer valued. source_edgelist (list):
 The edges in the source graph. target_nodelist (list):
 The nodes in the target graph. Should be integer valued. target_edgelist (list):
 The edges in the target graph. Returns: dict: The mapping from the source graph to the target graph. source model and s is a variable in the target model. """

    encoded_data = {'num_nodes': len(target_nodelist),
                    'num_edges': len(target_edgelist),
                    'edges': json.dumps(target_edgelist, separators=(',', ':')),
                    'tag': embedding_tag}

    select = \
        """
        SELECT
            source_node,
            chain
        FROM
            embedding_component_view
        WHERE
            embedding_tag = :tag AND
            target_edges = :edges AND
            target_num_nodes = :num_nodes AND
            target_num_edges = :num_edges
        """

    embedding = {v: json.loads(chain) for v, chain in cur.execute(select, encoded_data)}
    return embedding