code: def test_module_lap_pe(idtype):
      g = dgl.graph(
          ([2, 1, 0, 3, 1, 1], [3, 1, 1, 2, 1, 0]),
          idtype=idtype,
          device=F.ctx(),
      )
      tgt_eigval = F.copy_to(
          F.repeat(
              F.tensor([[1.1534e-17, 1.3333e00, 2.0, np.nan, np.nan]]),
              g.num_nodes(),
              dim=0,
          ),
          g.device,
      )
      tgt_pe = F.copy_to(
          F.tensor(
              [
                  [0.5, 0.86602539, 0.0, 0.0, 0.0],
                  [0.86602539, 0.5, 0.0, 0.0, 0.0],
                  [0.0, 0.0, 0.70710677, 0.0, 0.0],
                  [0.0, 0.0, 0.70710677, 0.0, 0.0],
              ]
          ),
          g.device,
      )
  
      # without padding (k<n)
      transform = dgl.LapPE(2, feat_name="lappe")
      new_g = transform(g)
      # tensorflow has no abs() api
      if dgl.backend.backend_name == "tensorflow":
          assert F.allclose(
              new_g.ndata["lappe"].__abs__(), tgt_pe[:, :2]
          )
      # pytorch & mxnet
      else:
          assert F.allclose(new_g.ndata["lappe"].abs(), tgt_pe[:, :2])
  
      # with padding (k>=n)
      transform = dgl.LapPE(5, feat_name="lappe", padding=True)
      new_g = transform(g)
      # tensorflow has no abs() api
      if dgl.backend.backend_name == "tensorflow":
          assert F.allclose(new_g.ndata["lappe"].__abs__(), tgt_pe)
      # pytorch & mxnet
      else:
          assert F.allclose(new_g.ndata["lappe"].abs(), tgt_pe)
  
      # with eigenvalues
      transform = dgl.LapPE(
          5, feat_name="lappe", eigval_name="eigval", padding=True
      )
      new_g = transform(g)
      # tensorflow has no abs() api
      if dgl.backend.backend_name == "tensorflow":
          assert F.allclose(
              new_g.ndata["eigval"][:, :3], tgt_eigval[:, :3]
          )
          assert F.allclose(new_g.ndata["lappe"].__abs__(), tgt_pe)
      # pytorch & mxnet
      else:
          assert F.allclose(
              new_g.ndata["eigval"][:, :3], tgt_eigval[:, :3]
          )
          assert F.allclose(new_g.ndata["lappe"].abs(), tgt_pe)
  
imports: import math
  import os
  import unittest
  import backend
  import dgl
  import dgl.function
  import dgl.partition
  import networkx
  import numpy
  import pytest
  from scipy import sparse
  from utils import parametrize_idtype
  from utils.graph_cases import get_cases
label_desc: Use image node_id 50 for calling a global function with example usage: test_module_lap_pe(idtype) without return types