code: def test_apply_nodes(idtype):
      def _upd(nodes):
          return {"h": nodes.data["h"] * 2}
  
      g = generate_graph(idtype)
      old = g.ndata["h"]
      g.apply_nodes(_upd)
      assert F.allclose(old * 2, g.ndata["h"])
      u = F.tensor([0, 3, 4, 6], g.idtype)
      g.apply_nodes(lambda nodes: {"h": nodes.data["h"] * 0.0}, u)
      assert F.allclose(F.gather_row(g.ndata["h"], u), F.zeros((4, D)))
  
imports: import warnings
  from collections import defaultdict
  import backend
  import dgl
  import networkx
  import numpy
  from utils import parametrize_idtype
label_desc: Use image node_id 10 for calling a global function with example usage: test_apply_nodes(idtype) and returns: dict