code: def test_split_edge_case(self):
      (
          G,
          x,
          y,
          edge_x,
          edge_y,
          edge_index,
          graph_x,
          graph_y,
      ) = simple_networkx_graph()
  
      dg = Graph(
          node_label=y,
          edge_label=edge_y,
          edge_index=edge_index,
          directed=True,
      )
      dg_node = dg.split()
      dg_num_nodes = dg.num_nodes
      self.assertEqual(
          dg_node[0].node_label_index.shape[0],
          int(dg_num_nodes * 0.8),
      )
      self.assertEqual(
          dg_node[1].node_label_index.shape[0],
          int(dg_num_nodes * 0.1),
      )
      self.assertEqual(
          dg_node[2].node_label_index.shape[0],
          dg.num_nodes
          - int(dg_num_nodes * 0.8)
          - int(dg_num_nodes * 0.1),
      )
  
      dg_edge = dg.split(task="edge")
      dg_num_edges = dg.num_edges
      edge_0 = int(dg_num_edges * 0.8)
      edge_1 = int(dg_num_edges * 0.1)
      edge_2 = dg.num_edges - edge_0 - edge_1
      self.assertEqual(dg_edge[0].edge_label_index.shape[1], edge_0)
      self.assertEqual(dg_edge[1].edge_label_index.shape[1], edge_1)
      self.assertEqual(dg_edge[2].edge_label_index.shape[1], edge_2)
  
      dg_link = dg.split(task="link_pred")
      dg_num_edges = dg.num_edges
      edge_0 = int(dg_num_edges * 0.8)
      edge_1 = int(dg_num_edges * 0.1)
      edge_2 = dg.num_edges - edge_0 - edge_1
      self.assertEqual(dg_link[0].edge_label_index.shape[1], edge_0)
      self.assertEqual(dg_link[1].edge_label_index.shape[1], edge_1)
      self.assertEqual(dg_link[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 5 for calling the TestGraphTensorBackend obj's underlying member method code with example usage: obj.test_split_edge_case() without return types