code: def anticlockwise_sort(pps):
      
      newpps = list()
      angles = np.zeros(len(pps), np.float)
      for ipp, pp in enumerate(pps):
          angles[ipp] = np.arctan2(pp[1], pp[0])
      iisorted = np.argsort(angles)
      for ii in range(len(pps)):
          newpps.append(pps[iisorted[ii]])
      return newpps
docs: Sort a list of 2D points in anticlockwise order
      :param pps: List of points to be sorted
      :return: Sorted list of points