<｜begin▁of▁sentence｜>### Instruction:
Given two MultiDiGraphs G1 and G2 with G1 edges set as [('A', 'B', 0), ('A', 'B', 1)] and G2 edges set as [('B', 'C', 0)], how can we create a read-only union view of the adjacency information from both G1 and G2 which allows us to iterate through the edges and their attributes?
### Response:
import networkx as nx

# Create two MultiDiGraphs
G1 = nx.MultiDiGraph()
G2 = nx.MultiDiGraph()

# Add edges to G1
G1.add_edge('A', 'B', key=0)
G1.add_edge('A', 'B', key=1)

# Add edges to G2
G2.add_edge('B', 'C', key=0)

# Create a UnionMultiAdjacency view
g_union = nx.classes.coreviews.UnionMultiAdjacency(G1._succ, G2._succ)

# Access the edge data
for u in g_union:
    for v, datadict in g_union[u].items():
        for key, eattr in datadict.items():
            print(f"Edge ({u}, {v}, {key}) with attributes {eattr}")
<|EOT|>
