code: def test_edge_ids():
      g = GraphData()
      g.add_nodes(10)
      for i in range(10):
          g.add_edge(src=i, tgt=(i + 1) % 10)
      # all edges are in the graph
      assert g.edge_ids([0, 1, 2, 3, 4], [1, 2, 3, 4, 5]) == [
          0,
          1,
          2,
          3,
          4,
      ]
      # some edges are missing
      try:
          g.edge_ids([0, 1, 2], [1, 2, 4])
          fail_here()
      except EdgeNotFoundException:
          pass
      # broadcasting
      g.add_edges(0, [2, 3, 4, 5, 6])
      assert g.edge_ids(0, [1, 2, 3, 4, 5, 6]) == [
          0,
          10,
          11,
          12,
          13,
          14,
      ]
  
imports: import gc
  import time
  import matplotlib.pyplot
  import torch
  import torch.nn
  import pytest
  from ...data.data import GraphData, from_batch, from_dgl, to_batch
  from ...data.utils import EdgeNotFoundException, SizeMismatchException
label_desc: Use image node_id 6 for calling a global function with example usage: test_edge_ids() without return types