def METHOD_NAME(self, linesP):
    points = []
    for i in range(0, len(linesP)):
        l = linesP[i]
        x_center = (float(
            (max(l[2], l[0]) - min(l[2], l[0]))) / 2.0 + min(l[2], l[0]))
        y_center = (float(
            (max(l[3], l[1]) - min(l[3], l[1]))) / 2.0 + min(l[3], l[1]))
        points.append([x_center, y_center])
    dbscan = DBSCAN(
        eps=50, min_samples=2, metric=self.get_distance).fit(points)
    labels = dbscan.labels_
    n_clusters_ = len(set(labels)) - (1 if -1 in labels else 0)
    cluster_list = list([] for i in range(n_clusters_))
    if linesP is not None:
        for i in range(0, len(linesP)):
            if labels[i] == -1:
                continue
            l = linesP[i]
            x1, y1, x2, y2 = l
            if y2 >= y1:
                cluster_list[labels[i]].append([x1, y1, x2, y2])
            else:
                ll = [x2, y2, x1, y1]
                cluster_list[labels[i]].append(ll)
    return cluster_list