def labels_to_clusters(X, labels):
    """Utility function for converting labels to clusters.
    
    Args:
        X (ndarray[m, n]):              input dataset
        labels (ndarray[m]):            labels of each point
    
    Returns:
        clusters (list, ndarray[i, n]): list of clusters (i denotes the size of each cluster)
    """
    return [X[labels==i] for i in range(labels.max() + 1)]