<｜begin▁of▁sentence｜>### Instruction:
Given a weighted undirected graph with edge set [(1, 2, 3), (2, 3, 7), (3, 4, 2), (4, 5, 1)], how can we calculate the current-flow betweenness centrality for the source node 1 and target node 5 using NetworkX?
### Response:
import networkx as nx
import numpy as np

# Create a weighted undirected graph
G = nx.Graph()
G.add_weighted_edges_from([(1, 2, 3), (2, 3, 7), (3, 4, 2), (4, 5, 1)])

# Define source and target nodes for current flow calculation
sources = [1]
targets = [5]

# Calculate current-flow betweenness centrality for the specified subsets
betweenness = nx.current_flow_betweenness_centrality_subset(G, sources, targets, normalized=True, weight='weight', dtype=np.float64, solver='lu')

print('Current-flow betweenness centrality for nodes:', betweenness)
<|EOT|>
