code: def test_remove_isolated_nodes():
      edge_index = torch.tensor([[0, 1, 0], [1, 0, 0]])
  
      out, _, mask = remove_isolated_nodes(edge_index)
      assert out.tolist() == [[0, 1, 0], [1, 0, 0]]
      assert mask.tolist() == [1, 1]
  
      if is_full_test():
          jit = torch.jit.script(remove_isolated_nodes)
          out, _, mask = jit(edge_index)
          assert out.tolist() == [[0, 1, 0], [1, 0, 0]]
          assert mask.tolist() == [1, 1]
  
      out, _, mask = remove_isolated_nodes(edge_index, num_nodes=3)
      assert out.tolist() == [[0, 1, 0], [1, 0, 0]]
      assert mask.tolist() == [1, 1, 0]
  
      edge_index = torch.tensor([[0, 2, 1, 0, 2], [2, 0, 1, 0, 2]])
      edge_attr = torch.tensor([1, 2, 3, 4, 5])
      out1, out2, mask = remove_isolated_nodes(edge_index, edge_attr)
      assert out1.tolist() == [[0, 1, 0, 1], [1, 0, 0, 1]]
      assert out2.tolist() == [1, 2, 4, 5]
      assert mask.tolist() == [1, 0, 1]
  
imports: import torch
  from torch_geometric.testing import is_full_test
  from torch_geometric.utils import contains_isolated_nodes, remove_isolated_nodes
label_desc: Use image node_id 2 for calling a global function with example usage: test_remove_isolated_nodes() without return types