code: def test_add_edges():
      g = GraphData()
      g.add_nodes(10)
  
      # Test wrong cases where one of the `src` and `tgt` is empty.
      try:
          g.add_edges([], [0, 1, 2])
          fail_here()
      except ValueError:
          pass
  
      try:
          g.add_edges([0, 1, 2], [])
          fail_here()
      except ValueError:
          pass
  
      # Test `src` and `tgt` size mismatch situation.
      try:
          g.add_edges([0, 1, 2], [1, 2])
          fail_here()
      except ValueError:
          pass
  
      # Test list autocomplete
      g.add_edges([0], [1, 2])
      g.add_edges([3, 4], [5])
      assert g.get_all_edges() == [(0, 1), (0, 2), (3, 5), (4, 5)]
  
      # Test normal add_edges
      g = GraphData()
      g.add_nodes(10)
      g.add_edges([0, 1, 2, 3, 4], [1, 2, 3, 4, 5])
      assert g.get_all_edges() == [
          (0, 1),
          (1, 2),
          (2, 3),
          (3, 4),
          (4, 5),
      ]
  
      # Test adding duplicate edges
      with pytest.warns(Warning):
          g.add_edges([0, 1], [1, 2])
  
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 5 for calling a global function with example usage: test_add_edges() without return types