<｜begin▁of▁sentence｜>### Instruction:
{'Description': 'Given the LEDA graph format data as a string representing a simple graph with 2 nodes and a labeled edge between them, how can one generate the corresponding NetworkX graph using the parse_leda function?', 'Data': 'LEDA.GRAPH\nstring\n-2\n-1\n2\n|{node 1 label}|\n|{node 2 label}|\n1\n1 2 0 |{edge label}|', 'Problem': "The task is to read a graph from a string in LEDA format and create a NetworkX graph object. The LEDA string contains two nodes labeled 'node 1 label' and 'node 2 label', and a single edge connecting these two nodes with an edge label 'edge label'."}
### Response:
import networkx as nx

leda_data = '''
LEDA.GRAPH
string
-2
-1
2
|{node 1 label}|
|{node 2 label}|
1
1 2 0 |{edge label}|
'''

G = nx.parse_leda(leda_data.split('\n'))
print('Nodes:', G.nodes(data=True))
print('Edges:', G.edges(data=True))
<|EOT|>
