<｜begin▁of▁sentence｜>### Instruction:
Given a Ladder graph with 4 rungs, generate a JSON representation of the graph where each node has an 'id' and 'label', and each edge has a 'source', 'target', and 'label'. How can this be achieved in Python using NetworkX?
### Response:
import networkx as nx

# Create a Ladder graph of length 4
L = nx.ladder_graph(4)

# Iterate over nodes to create a list of node labels
nodes = [{'id': n, 'label': f'Node {n}'} for n in L.nodes()]

# Iterate over edges to create a list of edges with labels
edges = [{'source': u, 'target': v, 'label': f'Edge {u}-{v}'} for u, v in L.edges()]

# Create a JSON object
graph_json = {'graph_nodes': nodes, 'graph_edges': edges}

# Print the JSON object
print(graph_json)
<|EOT|>
