code: def generate_split(
      num_samples: int, train_ratio: float, val_ratio: float
  ):
      """Utility function for generating training, validation and test set samples."""
      train_len = int(num_samples * train_ratio)
      val_len = int(num_samples * val_ratio)
      test_len = num_samples - train_len - val_len
  
      train_set, test_set, val_set = random_split(
          torch.arange(0, num_samples), (train_len, test_len, val_len)
      )
  
      idx_train, idx_test, idx_val = (
          train_set.indices,
          test_set.indices,
          val_set.indices,
      )
      train_mask = torch.zeros((num_samples,)).to(torch.bool)
      test_mask = torch.zeros((num_samples,)).to(torch.bool)
      val_mask = torch.zeros((num_samples,)).to(torch.bool)
  
      train_mask[idx_train] = True
      test_mask[idx_test] = True
      val_mask[idx_val] = True
  
      return train_mask, test_mask, val_mask
  
file_path: DIG/dig/sslgraph/utils/adaptive.py
imports: import torch
  from torch.utils.data import random_split
  from torch_geometric.utils import degree, remove_self_loops, get_laplacian, to_undirected, to_dense_adj, to_networkx, degree, to_undirected
  from torch_scatter import scatter
  import networkx
label_desc: Use image node_id 10 for calling a global function with example usage: generate_split(num_samples, train_ratio, val_ratio) and returns: train_mask,  test_mask,  val_mask