<｜begin▁of▁sentence｜>### Instruction:
Given a dictionary of dictionaries with one entry `{0: {1: {'weight': 1}}}` representing an edge from node 0 to node 1 with weight 1, how can we create and display a graph in NetworkX?
### Response:
import networkx as nx

# Dictionary of dictionaries representation of a graph
# Here each key of the outer dictionary is a node and the corresponding value is the dictionary
# of the neighbors of that node and the edge attributes

# Single edge (0, 1) with weight
graph_dict = {0: {1: {'weight': 1}}}

# Create a Graph using the from_dict_of_dicts function
G = nx.from_dict_of_dicts(graph_dict)

# Alternatively, you can directly pass the dictionary to the Graph constructor
# This method automatically infers the graph structure based on the dictionary representation
G = nx.Graph(graph_dict)

# Display nodes and edges
print('Nodes:', G.nodes())
print('Edges:', G.edges(data=True))
<|EOT|>
