code: def check_equivalence_between_heterographs(
      g1, g2, node_attrs=None, edge_attrs=None
  ):
      assert g1.ntypes == g2.ntypes
      assert g1.etypes == g2.etypes
      assert g1.canonical_etypes == g2.canonical_etypes
  
      for nty in g1.ntypes:
          assert g1.num_nodes(nty) == g2.num_nodes(nty)
  
      for ety in g1.etypes:
          if len(g1._etype2canonical[ety]) > 0:
              assert g1.num_edges(ety) == g2.num_edges(ety)
  
      for ety in g1.canonical_etypes:
          assert g1.num_edges(ety) == g2.num_edges(ety)
          src1, dst1, eid1 = g1.edges(etype=ety, form="all")
          src2, dst2, eid2 = g2.edges(etype=ety, form="all")
          assert F.allclose(src1, src2)
          assert F.allclose(dst1, dst2)
          assert F.allclose(eid1, eid2)
  
      if node_attrs is not None:
          for nty in node_attrs.keys():
              if g1.num_nodes(nty) == 0:
                  continue
              for feat_name in node_attrs[nty]:
                  assert F.allclose(
                      g1.nodes[nty].data[feat_name],
                      g2.nodes[nty].data[feat_name],
                  )
  
      if edge_attrs is not None:
          for ety in edge_attrs.keys():
              if g1.num_edges(ety) == 0:
                  continue
              for feat_name in edge_attrs[ety]:
                  assert F.allclose(
                      g1.edges[ety].data[feat_name],
                      g2.edges[ety].data[feat_name],
                  )
  
file_path: dgl/tests/python/common/test_batch-heterograph.py
imports: import unittest
  import backend
  import dgl
  import pytest
  from dgl.base import ALL
  from utils import check_graph_equal, get_cases, parametrize_idtype
label_desc: Use image node_id 1 for calling a global function with example usage: check_equivalence_between_heterographs(g1, g2, node_attrs, edge_attrs) without return types