def __incidence_to_adjacency(M, s=1, weighted=True):
    """	
		Helper method to obtain adjacency matrix from incidence matrix.
		
		Parameters
		----------
		M : scipy.sparse.csr.csr_matrix

		s : int, optional, default: 1

		weighted : boolean, optional, default: True

		Returns
		-------
		a matrix : scipy.sparse.csr.csr_matrix

		"""
    A = M.dot(M.transpose())
    A.setdiag(0)
    if s > 1:
        A = A.multiply(A >= s)
    if not weighted:
        A = (A > 0) * 1
    return A
