code: def test_apply_edges(idtype):
      def _upd(edges):
          return {"w": edges.data["w"] * 2}
  
      g = generate_graph(idtype)
      old = g.edata["w"]
      g.apply_edges(_upd)
      assert F.allclose(old * 2, g.edata["w"])
      u = F.tensor([0, 0, 0, 4, 5, 6], g.idtype)
      v = F.tensor([1, 2, 3, 9, 9, 9], g.idtype)
      g.apply_edges(lambda edges: {"w": edges.data["w"] * 0.0}, (u, v))
      eid = F.tensor(g.edge_ids(u, v))
      assert F.allclose(
          F.gather_row(g.edata["w"], eid), F.zeros((6, 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 11 for calling a global function with example usage: test_apply_edges(idtype) and returns: dict