code: def test_module_row_feat_normalizer(idtype):
      # Case1: Normalize features of a homogeneous graph.
      transform = dgl.RowFeatNormalizer(
          subtract_min=True,
          node_feat_names=["h"],
          edge_feat_names=["w"],
      )
      g = dgl.rand_graph(5, 5, idtype=idtype, device=F.ctx())
      g.ndata["h"] = F.randn((g.num_nodes(), 128))
      g.edata["w"] = F.randn((g.num_edges(), 128))
      g = transform(g)
      assert g.ndata["h"].shape == (g.num_nodes(), 128)
      assert g.edata["w"].shape == (g.num_edges(), 128)
      assert F.allclose(
          g.ndata["h"].sum(1), F.tensor([1.0, 1.0, 1.0, 1.0, 1.0])
      )
      assert F.allclose(
          g.edata["w"].sum(1), F.tensor([1.0, 1.0, 1.0, 1.0, 1.0])
      )
  
      # Case2: Normalize features of a heterogeneous graph.
      transform = dgl.RowFeatNormalizer(
          subtract_min=True,
          node_feat_names=["h", "h2"],
          edge_feat_names=["w"],
      )
      g = dgl.heterograph(
          {
              ("user", "follows", "user"): (
                  F.tensor([1, 2]),
                  F.tensor([3, 4]),
              ),
              ("player", "plays", "game"): (
                  F.tensor([2, 2]),
                  F.tensor([1, 1]),
              ),
          },
          idtype=idtype,
          device=F.ctx(),
      )
      g.ndata["h"] = {
          "game": F.randn((2, 128)),
          "player": F.randn((3, 128)),
      }
      g.ndata["h2"] = {"user": F.randn((5, 128))}
      g.edata["w"] = {
          ("user", "follows", "user"): F.randn((2, 128)),
          ("player", "plays", "game"): F.randn((2, 128)),
      }
      g = transform(g)
      assert g.ndata["h"]["game"].shape == (2, 128)
      assert g.ndata["h"]["player"].shape == (3, 128)
      assert g.ndata["h2"]["user"].shape == (5, 128)
      assert g.edata["w"][("user", "follows", "user")].shape == (2, 128)
      assert g.edata["w"][("player", "plays", "game")].shape == (2, 128)
      assert F.allclose(
          g.ndata["h"]["game"].sum(1), F.tensor([1.0, 1.0])
      )
      assert F.allclose(
          g.ndata["h"]["player"].sum(1), F.tensor([1.0, 1.0, 1.0])
      )
      assert F.allclose(
          g.ndata["h2"]["user"].sum(1),
          F.tensor([1.0, 1.0, 1.0, 1.0, 1.0]),
      )
      assert F.allclose(
          g.edata["w"][("user", "follows", "user")].sum(1),
          F.tensor([1.0, 1.0]),
      )
      assert F.allclose(
          g.edata["w"][("player", "plays", "game")].sum(1),
          F.tensor([1.0, 1.0]),
      )
  
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 52 for calling a global function with example usage: test_module_row_feat_normalizer(idtype) without return types