code: def get_coordinates(graphs, grid_side, coarsening_levels, perm):
      rst = []
      for l in range(coarsening_levels + 1):
          xs, ys = [], []
          for i in range(graphs[l].num_nodes()):
              cnt = eps
              x_accum = 0
              y_accum = 0
              for j in range(i * 2**l, (i + 1) * 2**l):
                  if perm[j] < grid_side**2:
                      x_accum += perm[j] // grid_side
                      y_accum += perm[j] % grid_side
                      cnt += 1
              xs.append(x_accum / cnt)
              ys.append(y_accum / cnt)
          rst.append(
              th.cat(
                  [
                      th.tensor(xs).view(-1, 1),
                      th.tensor(ys).view(-1, 1),
                  ],
                  -1,
              )
          )
      return rst
  
label_desc: Use image node_id 1 for calling a global function with example usage: get_coordinates(graphs, grid_side, coarsening_levels, perm) and returns: rst