human
I am working on the file "2015_2016/lab2/triangulation_line_sweep.ipynb".
The first task is:
Test the orientation method on a simple test case.
Can you write Python program for it?
 What is a the Python program you requested?
assistant
#Here is the Python program you requested.

a = Point(0, 0)
b = Point(1, 0)
c = Point(0, 1)
d = Point(2, 0)
assert orientation(a, b, c) > 0
assert orientation(a, b, d) == 0
assert orientation(a, c, b) < 0

class Node:
    """
    Node in a doubly linked link list.
    """
    def __init__(self, data):
        self.data = data
        self.p, self.n = self, self
    
    def link_after(self, new_node):
        '''
        Insert new_node into linked list after the self node.
        '''
        new_node.n, new_node.p = self.n, self
        self.n.p, self.n = new_node, new_node
    
    def __repr__(self):
        ret = "{0}".format(self.data)
        c = self
        while c.n != self:
            c = c.n
            ret += " <-> {0}".format(c.data)
        return ret

from random import random

def generify(points, epsilon=0.0001):
    """
    Jiggle the points coordinates just a little so that they are in the
    general position. 
    Returns the generator.
    """
    for point in points:
        e = 2*(random()-0.5)*epsilon
        d = 2*(random()-0.5)*epsilon*e
        yield Point(point.x + e, point.y + d)