code: def test_split(self):
      pyg_dataset = Planetoid("./cora", "Cora")
  
      x = pyg_dataset[0].x
      y = pyg_dataset[0].y
      edge_index = pyg_dataset[0].edge_index
  
      row, col = copy.deepcopy(edge_index)
      mask = row < col
      row, col = row[mask], col[mask]
      edge_index = torch.stack([row, col], dim=0)
      edge_index = torch.cat(
          [edge_index, torch.flip(edge_index, [0])], dim=1
      )
  
      dg = Graph(
          node_feature=x,
          node_label=y,
          edge_index=edge_index,
          directed=False,
      )
  
      dg_node = dg.split()
      dg_num_nodes = dg.num_nodes
      node_0 = int(dg_num_nodes * 0.8)
      node_1 = int(dg_num_nodes * 0.1)
      node_2 = dg_num_nodes - node_0 - node_1
      self.assertEqual(dg_node[0].node_label_index.shape[0], node_0)
      self.assertEqual(dg_node[1].node_label_index.shape[0], node_1)
      self.assertEqual(dg_node[2].node_label_index.shape[0], node_2)
  
      for split_ratio in [
          [0.1, 0.4, 0.5],
          [0.4, 0.3, 0.3],
          [0.7, 0.2, 0.1],
      ]:
          dg_link_custom = dg.split(
              task="link_pred", split_ratio=split_ratio
          )
          dg_num_edges = dg.num_edges
          edge_0 = 2 * int(split_ratio[0] * dg_num_edges)
          edge_1 = 2 * int(split_ratio[1] * dg_num_edges)
          edge_2 = 2 * (
              dg_num_edges
              - int(split_ratio[0] * dg_num_edges)
              - int(split_ratio[1] * dg_num_edges)
          )
          self.assertEqual(
              dg_link_custom[0].edge_label_index.shape[1],
              edge_0,
          )
          self.assertEqual(
              dg_link_custom[1].edge_label_index.shape[1],
              edge_1,
          )
          self.assertEqual(
              dg_link_custom[2].edge_label_index.shape[1],
              edge_2,
          )
  
file_path: deepsnap/tests/test_graph_tensor_backend.py
imports: import copy
  import torch
  import unittest
  import numpy
  from tests.utils import simple_networkx_graph
  from deepsnap.graph import Graph
  from torch_geometric.datasets import Planetoid
label_desc: Use image node_id 6 for calling the TestGraphTensorBackend obj's underlying member method code with example usage: obj.test_split() without return types