def segmentOnLine(seg,line):
    """Determines if the input line segment is a proper part of the input line,
    i.e. if it consists of two consecutive segments on the input line.
    Args:
        seg: list two points comprising the segment to check
        line: list of any number of points comprising the full line
    Returns:
        True if the two segment points are consecutive points on the input line,
        False otherwise."""
    for i in range(len(line)-1):
        start=line[i]
        # check forward direction
        if start[0]==seg[0][0] and start[1]==seg[0][1]:
            end=line[i+1]
            if end[0]==seg[1][0] and end[1]==seg[1][1]:
                return True
        # check backwards direction
        if start[0]==seg[1][0] and start[1]==seg[1][1]:
            end=line[i+1]
            if end[0]==seg[0][0] and end[1]==seg[0][1]:
                return True
    return False