<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ends_to_curve(start_node, end_node):
 """Convert a "pair" of intersection nodes to a curve segment. .. note:: This is a helper used only by :func:`basic_interior_combine`, which in turn is only used by :func:`combine_intersections`. .. note:: This function could specialize to the first or second segment attached to ``start_node`` and ``end_node``. We determine first / second based on the classification of ``start_node``, but the callers of this function could provide that information / isolate the base curve and the two parameters for us. .. note:: This only checks the classification of the ``start_node``. Args: start_node (.Intersection):
 The beginning of a segment. end_node (.Intersection):
 The end of (the same) segment. Returns: Tuple[int, float, float]: The 3-tuple of: * The edge index along the first surface (if in ``{0, 1, 2}``) or the edge index along the second surface shifted to the right by 3 (if in ``{3, 4, 5}``) * The start parameter along the edge * The end parameter along the edge Raises: ValueError: If the ``start_node`` and ``end_node`` disagree on the first curve when classified as "FIRST". ValueError: If the ``start_node`` and ``end_node`` disagree on the second curve when classified as "SECOND". ValueError: If the ``start_node`` and ``end_node`` disagree on the both curves when classified as "COINCIDENT". ValueError: If the ``start_node`` is not classified as :attr:`~.IntersectionClassification.FIRST`, :attr:`~.IntersectionClassification.TANGENT_FIRST`, :attr:`~.IntersectionClassification.SECOND`, :attr:`~.IntersectionClassification.TANGENT_SECOND` or :attr:`~.IntersectionClassification.COINCIDENT`. """

    if is_first(start_node.interior_curve):
        if end_node.index_first != start_node.index_first:
            raise ValueError(_WRONG_CURVE)

        return start_node.index_first, start_node.s, end_node.s

    elif is_second(start_node.interior_curve):
        if end_node.index_second != start_node.index_second:
            raise ValueError(_WRONG_CURVE)

        return start_node.index_second + 3, start_node.t, end_node.t

    elif start_node.interior_curve == CLASSIFICATION_T.COINCIDENT:
        if end_node.index_first == start_node.index_first:
            return start_node.index_first, start_node.s, end_node.s

        elif end_node.index_second == start_node.index_second:
            return start_node.index_second + 3, start_node.t, end_node.t

        else:
            raise ValueError(_WRONG_CURVE)

    else:
        raise ValueError(
            'Segment start must be classified as "FIRST", "TANGENT_FIRST", '
            '"SECOND", "TANGENT_SECOND" or "COINCIDENT".'
        )