<｜begin▁of▁sentence｜>### Instruction:
Given a list of 2D points such as `[(1, 2), (3, 4), (5, 6), (7, 8)]` and a desired corner radius, e.g., `2`, how can you use `calculate_corner_radii` function to determine the maximum allowable corner radius for each point ensuring it's never larger than half the minimum distance to its neighboring points?
### Response:
import networkx as nx

# Define a function based on the provided API description
def calculate_corner_radii(points, desired_radius):
    radii = []
    for i, point in enumerate(points):
        min_dist = float('inf')
        for j, other_point in enumerate(points):
            if i != j:
                dist = nx.utils.euclidean_distance(point, other_point)
                min_dist = min(min_dist, dist)
        radii.append(min(min_dist / 2, desired_radius))
    return radii

# Sample points and desired radius
desired_radius = 2
points = [(1, 2), (3, 4), (5, 6), (7, 8)]

# Use the above function to calculate corner radii for each point
radii = calculate_corner_radii(points, desired_radius)
print('Calculated corner radii:', radii)
<|EOT|>
