code: def test_edge_homophily(idtype):
      # IfChangeThenChange: python/dgl/homophily.py
      # Update the docstring example.
      device = F.ctx()
      graph = dgl.graph(
          ([1, 2, 0, 4], [0, 1, 2, 3]), idtype=idtype, device=device
      )
      y = F.tensor([0, 0, 0, 0, 1])
      assert math.isclose(dgl.edge_homophily(graph, y), 0.75)
  
file_path: dgl/tests/python/common/test_homophily.py
imports: import math
  import unittest
  import backend
  import dgl
  from utils import parametrize_idtype
label_desc: Use image node_id 2 for calling a global function with example usage: test_edge_homophily(idtype) without return types