code: def perm_data(x, indices):
      """
      Permute data matrix, i.e. exchange node ids,
      so that binary unions form the clustering tree.
      """
      if indices is None:
          return x
  
      N, M = x.shape
      Mnew = len(indices)
      assert Mnew >= M
      xnew = np.empty((N, Mnew))
      for i, j in enumerate(indices):
          # Existing vertex, i.e. real data.
          if j < M:
              xnew[:, i] = x[:, j]
          # Fake vertex because of singeltons.
          # They will stay 0 so that max pooling chooses the singelton.
          # Or -infty ?
          else:
              xnew[:, i] = np.zeros(N)
      return xnew
  
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 9 for calling a global function with example usage: perm_data(x, indices) and returns: xnew, x