def line_intersects_segment(line, line_segment):
    """Returns the intersection the Line and LineSegment or None if they do
    not intersect.

    This function is useful for splitting polygons by a straight line.
    """

    linesegform = line_segment.to_line()
    if line.is_parallel_to(linesegform):
        return None
    else:
        p = line.intersection(linesegform)
        # Is the intersection on the line_segment?
        if line_segment.between(p):
            return p
        else:
            return None