code: def test_edge_subgraph():
      # Test when the graph has no node data and edge data.
      g = generate_graph(add_data=False)
      eid = [0, 2, 3, 6, 7, 9]
  
      # relabel=True
      sg = g.edge_subgraph(eid)
      assert F.array_equal(
          sg.ndata[dgl.NID], F.tensor([0, 2, 4, 5, 1, 9], g.idtype)
      )
      assert F.array_equal(sg.edata[dgl.EID], F.tensor(eid, g.idtype))
      sg.ndata["h"] = F.arange(0, sg.num_nodes())
      sg.edata["h"] = F.arange(0, sg.num_edges())
  
      # relabel=False
      sg = g.edge_subgraph(eid, relabel_nodes=False)
      assert g.num_nodes() == sg.num_nodes()
      assert F.array_equal(sg.edata[dgl.EID], F.tensor(eid, g.idtype))
      sg.ndata["h"] = F.arange(0, sg.num_nodes())
      sg.edata["h"] = F.arange(0, sg.num_edges())
  
imports: import unittest
  import backend
  import dgl
  import networkx
  import numpy
  import pytest
  import scipy.sparse
  from utils import parametrize_idtype
label_desc: Use image node_id 2 for calling a global function with example usage: test_edge_subgraph() without return types