from scipy.sparse import csr_array
from scipy.sparse.csgraph import connected_components



def CC(gram,threshold ):
	graph = csr_array((gram.numpy() > threshold ).astype(int))
	n_components, labels = connected_components(csgraph=graph, directed=False, return_labels=True)
	return labels








