human
Complete this python program:
def clockwise_sort(poly):
assistant
#Here is the Python program you requested.

    """Returns the same polygon with points sorted in clockwise order.
    Note that it\s necessary for input points to be sorted in some order
    (clockwise or anti-clockwise) for the algorithm to work. As a convention
    algorithm has been implemented keeping clockwise orientation in mind.
    Parameters
    poly: 2-Polytope
    Examples
    >>> from sympy.integrals.intpoly import clockwise_sort
    >>> from sympy.geometry.point import Point
    >>> from sympy.geometry.polygon import Polygon
    >>> clockwise_sort(Polygon(Point(0, 0), Point(1, 0), Point(1, 1)))
    Triangle(Point2D(1, 1), Point2D(1, 0), Point2D(0, 0))
    """
    n = len(poly.vertices)
    vertices = list(poly.vertices)
    center = Point((sum(map((lambda vertex: vertex.x), poly.vertices)) / n), (sum(map((lambda vertex: vertex.y), poly.vertices)) / n))
    def compareTo(a, b):
        if (((a.x - center.x) >= S.Zero) and ((b.x - center.x) < S.Zero)):
            return S((-1))
        elif (((a.x - center.x) < S.Zero) and ((b.x - center.x) >= S.Zero)):
            return S(1)
        elif (((a.x - center.x) == S.Zero) and ((b.x - center.x) == S.Zero)):
            if (((a.y - center.y) >= S.Zero) or ((b.y - center.y) >= S.Zero)):
                return (S((-1)) if (a.y > b.y) else S(1))
            return (S((-1)) if (b.y > a.y) else S(1))
        det = (((a.x - center.x) * (b.y - center.y)) - ((b.x - center.x) * (a.y - center.y)))
        if (det < S.Zero):
            return S((-1))
        elif (det > S.Zero):
            return S(1)
        first = (((a.x - center.x) * (a.x - center.x)) + ((a.y - center.y) * (a.y - center.y)))
        second = (((b.x - center.x) * (b.x - center.x)) + ((b.y - center.y) * (b.y - center.y)))
        return (S((-1)) if (first > second) else S(1))
    return Polygon(*sorted(vertices, key=cmp_to_key(compareTo)))