code: def test_random_link_split_insufficient_negative_edges():
      edge_index = torch.tensor(
          [[0, 0, 1, 1, 2, 2], [1, 3, 0, 2, 0, 1]]
      )
      data = Data(edge_index=edge_index, num_nodes=4)
  
      transform = RandomLinkSplit(
          num_val=0.34,
          num_test=0.34,
          is_undirected=False,
          neg_sampling_ratio=2,
          split_labels=True,
      )
  
      with pytest.warns(UserWarning, match="not enough negative edges"):
          train_data, val_data, test_data = transform(data)
  
      assert train_data.neg_edge_label_index.size() == (2, 2)
      assert val_data.neg_edge_label_index.size() == (2, 2)
      assert test_data.neg_edge_label_index.size() == (2, 2)
  
file_path: pytorch_geometric/test/transforms/test_random_link_split.py
imports: import pytest
  import torch
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.testing import get_random_edge_index, onlyFullTest, onlyOnline
  from torch_geometric.transforms import RandomLinkSplit
  from torch_geometric.utils import is_undirected, to_undirected
label_desc: Use image node_id 6 for calling a global function with example usage: test_random_link_split_insufficient_negative_edges() without return types