code: def assert_same_num_edges_can_etypes(gs, g):
      for can_etype in g.canonical_etypes:
          assert g.num_edges(can_etype) == gs.num_edges(can_etype)
  
imports: from cugraph.utilities.utils import import_optional
label_desc: Use image node_id 3 for calling a global function with example usage: assert_same_num_edges_can_etypes(gs, g) without return types