code: def test_coalesce_without_duplicates():
      edge_index = torch.tensor([[2, 1, 1, 0], [1, 2, 0, 1]])
      edge_attr = torch.tensor([[1], [2], [3], [4]])
  
      out = coalesce(edge_index)
      assert out.tolist() == [[0, 1, 1, 2], [1, 0, 2, 1]]
  
      out = coalesce(edge_index, None)
      assert out[0].tolist() == [[0, 1, 1, 2], [1, 0, 2, 1]]
      assert out[1] is None
  
      out = coalesce(edge_index, edge_attr)
      assert out[0].tolist() == [[0, 1, 1, 2], [1, 0, 2, 1]]
      assert out[1].tolist() == [[4], [3], [2], [1]]
  
      out = coalesce(edge_index, [edge_attr, edge_attr.view(-1)])
      assert out[0].tolist() == [[0, 1, 1, 2], [1, 0, 2, 1]]
      assert out[1][0].tolist() == [[4], [3], [2], [1]]
      assert out[1][1].tolist() == [4, 3, 2, 1]
  
imports: from typing import List, Optional, Tuple
  import torch
  from torch import Tensor
  from torch_geometric.utils import coalesce
label_desc: Use image node_id 2 for calling a global function with example usage: test_coalesce_without_duplicates() without return types