<｜begin▁of▁sentence｜>### Instruction:
Given a graph with two nodes at positions (0, 0) and (1, 1) and a requirement to visually represent a curved edge between these two nodes, how can you calculate the Bezier control points for this curved edge using a given helper function?
### Response:
import networkx as nx

# Create a graph and add two nodes
g = nx.Graph()
g.add_node(1, pos=(0, 0))
g.add_node(2, pos=(1, 1))

# Add a curved edge between the nodes with control points
g.add_edge(1, 2, bezier=[[0.25, 0.25], [0.75, 0.75]])

# Function to calculate Bezier control points
# for a curved edge
def get_bezier_control_points_for_curved_edge(x1, y1, x2, y2):
    mid_x, mid_y = (x1 + x2) / 2.0, (y1 + y2) / 2.0
    control_point_1 = (mid_x + y1 - y2, mid_y + x2 - x1)
    control_point_2 = (mid_x + y2 - y1, mid_y + x1 - x2)
    return control_point_1, control_point_2

# Get the position of nodes
pos = nx.get_node_attributes(g, 'pos')

# Calculate Bezier control points
control_points = get_bezier_control_points_for_curved_edge(*pos[1], *pos[2])
print('Bezier control points for curved edge:', control_points)
<|EOT|>
