<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with edges [(1, 2), (2, 3), (3, 2), (2, 1)], how can you generate node degree-degree pairs for edges, considering the degree type for the source node as 'out' and for the target node as 'in' using NetworkX?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()
# Add edges
d = [(1, 2), (2, 3), (3, 2), (2, 1)]
G.add_edges_from(d)
# Generate node degree-degree pairs for edges
for x, y in nx.node_degree_xy(G, x='out', y='in'):
 print((x, y))
<|EOT|>
