<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def segments_distance(segment1, segment2):
 """Calculate the distance between two line segments in the plane. '1.41' '0.00' '0.00' """

    assert isinstance(segment1, LineSegment), \
        "segment1 is not a LineSegment, but a %s" % type(segment1)
    assert isinstance(segment2, LineSegment), \
        "segment2 is not a LineSegment, but a %s" % type(segment2)
    if len(get_segments_intersections(segment1, segment2)) >= 1:
        return 0
    # try each of the 4 vertices w/the other segment
    distances = []
    distances.append(point_segment_distance(segment1.p1, segment2))
    distances.append(point_segment_distance(segment1.p2, segment2))
    distances.append(point_segment_distance(segment2.p1, segment1))
    distances.append(point_segment_distance(segment2.p2, segment1))
    return min(distances)