code: def coarsen(A, levels):
      graphs, parents = HEM(A, levels)
      perms = compute_perm(parents)
  
      laplacians = []
      for i, A in enumerate(graphs):
          M, M = A.shape
  
          if i < levels:
              A = perm_adjacency(A, perms[i])
  
          A = A.tocsr()
          A.eliminate_zeros()
          Mnew, Mnew = A.shape
          print(
              "Layer {0}: M_{0} = |V| = {1} nodes ({2} added), |E| = {3} edges".format(
                  i, Mnew, Mnew - M, A.nnz // 2
              )
          )
  
          L = laplacian(A, normalized=True)
          laplacians.append(L)
  
      return laplacians, perms[0] if len(perms) > 0 else None
  
file_path: dgl/examples/pytorch/model_zoo/geometric/coarsening.py
imports: import numpy
  import scipy.sparse
  import sklearn.metrics
label_desc: Use image node_id 4 for calling a global function with example usage: coarsen(A, levels) and returns: laplacians,  unknown