code: def test_add_remaining_self_loops():
      edge_index = torch.tensor([[0, 1, 0], [1, 0, 0]])
      edge_weight = torch.tensor([0.5, 0.5, 0.5])
      edge_attr = torch.eye(3)
  
      expected = [[0, 1, 0, 1], [1, 0, 0, 1]]
  
      out = add_remaining_self_loops(edge_index, edge_weight)
      assert out[0].tolist() == expected
      assert out[1].tolist() == [0.5, 0.5, 0.5, 1]
  
      out = add_remaining_self_loops(
          edge_index, edge_weight, fill_value=5
      )
      assert out[0].tolist() == expected
      assert out[1].tolist() == [0.5, 0.5, 0.5, 5.0]
  
      out = add_remaining_self_loops(
          edge_index, edge_weight, fill_value=torch.tensor(2.0)
      )
      assert out[0].tolist() == expected
      assert out[1].tolist() == [0.5, 0.5, 0.5, 2.0]
  
      out = add_remaining_self_loops(
          edge_index, edge_weight, fill_value="add"
      )
      assert out[0].tolist() == expected
      assert out[1].tolist() == [0.5, 0.5, 0.5, 0.5]
  
      # Test with `edge_attr`:
      out = add_remaining_self_loops(
          edge_index,
          edge_attr,
          fill_value=torch.tensor([0.0, 1.0, 0.0]),
      )
      assert out[0].tolist() == expected
      assert out[1].tolist() == [
          [1.0, 0.0, 0.0],
          [0.0, 1.0, 0.0],
          [0.0, 0.0, 1.0],
          [0.0, 1.0, 0.0],
      ]
  
      edge_index = EdgeIndex(
          edge_index,
          sparse_size=(2, 2),
          sort_order="row",
          is_undirected=True,
      )
      out, _ = add_remaining_self_loops(edge_index)
      assert out.tolist() == expected
      assert out.sparse_size() == (2, 2)
      assert out.sort_order is None
      assert out.is_undirected
  
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 6 for calling a global function with example usage: test_add_remaining_self_loops() without return types