code: def test_remove_self_loops():
      edge_index = torch.tensor([[0, 1, 0], [1, 0, 0]])
      edge_attr = torch.tensor([[1, 2], [3, 4], [5, 6]])
  
      expected = [[0, 1], [1, 0]]
  
      out = remove_self_loops(edge_index)
      assert out[0].tolist() == expected
      assert out[1] is None
  
      out = remove_self_loops(edge_index, edge_attr)
      assert out[0].tolist() == expected
      assert out[1].tolist() == [[1, 2], [3, 4]]
  
      adj = to_torch_coo_tensor(edge_index)
      adj, _ = remove_self_loops(adj)
      assert torch.diag(adj.to_dense()).tolist() == [0, 0]
  
      edge_index = EdgeIndex(
          edge_index,
          sparse_size=(2, 2),
          sort_order="row",
          is_undirected=True,
      )
      out = remove_self_loops(edge_index)
      assert out[0].tolist() == expected
      assert out[0].sparse_size() == (2, 2)
      assert out[0].sort_order == "row"
      assert out[0].is_undirected
      assert out[1] is None
  
      out = remove_self_loops(edge_index, edge_attr)
      assert out[0].tolist() == expected
      assert out[0].sparse_size() == (2, 2)
      assert out[0].sort_order == "row"
      assert out[0].is_undirected
      assert out[1].tolist() == [[1, 2], [3, 4]]
  
file_path: pytorch_geometric/test/utils/test_loop.py
imports: import torch
  from torch_geometric import EdgeIndex
  from torch_geometric.utils import add_remaining_self_loops, add_self_loops, contains_self_loops, get_self_loop_attr, remove_self_loops, segregate_self_loops, to_torch_coo_tensor
label_desc: Use image node_id 2 for calling a global function with example usage: test_remove_self_loops() without return types