<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _specialize_surface(nodes, degree, weights_a, weights_b, weights_c):
 """Specialize a surface to a reparameterization .. note:: There is also a Fortran implementation of this function, which will be used if it can be built. Does so by taking three points (in barycentric form) within the reference triangle and then reparameterizing the surface onto the triangle formed by those three points. .. note:: This assumes the surface is degree 1 or greater but doesn't check. .. note:: This is used **only** as a helper for :func:`_subdivide_nodes`, however it may be worth adding this to :class:`Surface` as an analogue to :meth:`Curve.specialize`. Args: nodes (numpy.ndarray):
 Control points for a surface. degree (int):
 The degree of the surface. weights_a (numpy.ndarray):
 Triple (1D array) of barycentric weights for a point in the reference triangle weights_b (numpy.ndarray):
 Triple (1D array) of barycentric weights for a point in the reference triangle weights_c (numpy.ndarray):
 Triple (1D array) of barycentric weights for a point in the reference triangle Returns: numpy.ndarray: The control points for the specialized surface. """

    # Uses A-->0, B-->1, C-->2 to represent the specialization used.
    partial_vals = {
        (0,): de_casteljau_one_round(nodes, degree, *weights_a),
        (1,): de_casteljau_one_round(nodes, degree, *weights_b),
        (2,): de_casteljau_one_round(nodes, degree, *weights_c),
    }
    for reduced_deg in six.moves.xrange(degree - 1, 0, -1):
        new_partial = {}
        transform = make_transform(
            reduced_deg, weights_a, weights_b, weights_c
        )
        for key, sub_nodes in six.iteritems(partial_vals):
            # Our keys are ascending so we increment from the last value.
            for next_id in six.moves.xrange(key[-1], 2 + 1):
                new_key = key + (next_id,)
                new_partial[new_key] = _helpers.matrix_product(
                    sub_nodes, transform[next_id]
                )
        partial_vals = new_partial
    return reduced_to_matrix(nodes.shape, degree, partial_vals)