def cluster(order, distance, points, threshold):
    """ Given the output of the options algorithm,
    compute the clusters:
    @param order The order of the points
    @param distance The relative distances of the points
    @param points The actual points
    @param threshold The threshold value to cluster on
    @returns A list of cluster groups
    """
clusters = [[]]
points = sorted(zip(order, distance, points))
splits = ((v > threshold, p) for i, v, p in points)
for iscluster, point in splits:
    pass
Реализация алгоритма OPTICS (кластеризации) на Python