def _dunn(data=None, dist=None, labels=None):
    clusters = set(labels)
    inter_dists = [dist[np.ix_((labels == i), (labels == j))].min() for (i, j) in _get_clust_pairs(clusters)]
    intra_dists = [dist[np.ix_((labels == i), (labels == i))].max() for i in clusters]
    return (min(inter_dists) / max(intra_dists))
def _dunn(data=None, dist=None, labels=None):
    clusters = set(labels)
    inter_dists = [dist[np.ix_((labels == i), (labels == j))].min() for (i, j) in _get_clust_pairs(clusters)]
    intra_dists = [dist[np.ix_((labels == i), (labels == i))].max() for i in clusters]
    return (min(inter_dists) / max(intra_dists))