code: def connected_sets(C, directed=True):
      r
      if isdense(C):
          return sparse.connectivity.connected_sets(csr_matrix(C), directed=directed)
      else:
          return sparse.connectivity.connected_sets(C, directed=directed)