code: def test_module_feat_mask(idtype):
      # Case1: Mask node and edge feature tensors of a homogeneous graph.
      transform = dgl.FeatMask(
          node_feat_names=["h"], edge_feat_names=["w"]
      )
      g = dgl.rand_graph(5, 20, idtype=idtype, device=F.ctx())
      g.ndata["h"] = F.ones((g.num_nodes(), 10))
      g.edata["w"] = F.ones((g.num_edges(), 20))
      g = transform(g)
      assert g.device == g.device
      assert g.idtype == g.idtype
      assert g.ndata["h"].shape == (g.num_nodes(), 10)
      assert g.edata["w"].shape == (g.num_edges(), 20)
  
      # Case2: Mask node and edge feature tensors of a heterogeneous graph.
      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, 5)),
          "player": F.randn((3, 5)),
      }
      g.edata["w"] = {
          ("user", "follows", "user"): F.randn((2, 5)),
          ("player", "plays", "game"): F.randn((2, 5)),
      }
      g = transform(g)
      assert g.device == g.device
      assert g.idtype == g.idtype
      assert g.ndata["h"]["game"].shape == (2, 5)
      assert g.ndata["h"]["player"].shape == (3, 5)
      assert g.edata["w"][("user", "follows", "user")].shape == (2, 5)
      assert g.edata["w"][("player", "plays", "game")].shape == (2, 5)
  
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 53 for calling a global function with example usage: test_module_feat_mask(idtype) without return types