code: def test_linkx_homophily(idtype):
      # IfChangeThenChange: python/dgl/homophily.py
      # Update the docstring example.
      device = F.ctx()
      graph = dgl.graph(([0, 1, 2, 3], [1, 2, 0, 4]), device=device)
      y = F.tensor([0, 0, 0, 0, 1])
      assert math.isclose(
          dgl.linkx_homophily(graph, y), 0.19999998807907104
      )
  
      y = F.tensor([0, 1, 2, 3, 4])
      assert math.isclose(
          dgl.linkx_homophily(graph, y), 0.0000000000000000
      )
  
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 3 for calling a global function with example usage: test_linkx_homophily(idtype) without return types