<｜begin▁of▁sentence｜>### Instruction:
Given a dictionary of dictionaries representing the adjacency structure of a graph with weighted edges, how can you create and display a NetworkX graph from that data structure?
### Response:
import networkx as nx

# Create a dictionary of dictionaries representation of a graph
dod = {0: {1: {'weight': 1}}, 1: {2: {'weight': 2}, 0: {'weight': 1}}, 2: {1: {'weight': 2}}}

# Use the from_dict_of_dicts function to create a NetworkX graph from the dictionary of dictionaries
G = nx.from_dict_of_dicts(dod)

# Print the edges with attributes
for u, v, data in G.edges(data=True):
    print((u, v, data))
<|EOT|>
