def _explore_concatenation(explore, g, node):
    """
    Concatenation is just taking all the incoming edges and plugging them into
    the left node, making a connection between the left and the right node and
    then taking all the outgoing edges and plugging them into the right node.
    """
    explore.add(node.left)
    explore.add(node.right)
    g.add_node(node.left)
    g.add_node(node.right)
    for p in g.predecessors(node):
        data = g.get_edge_data(p, node, default={})
        g.add_edge(p, node.left, **data)
    g.add_edge(node.left, node.right)
    for s in g.successors(node):
        data = g.get_edge_data(node, s, default={})
        g.add_edge(node.right, s, **data)
    g.remove_node(node)
