code: def random_planetoid_splits(data, num_classes):
      # Set new random planetoid splits:
      # * 20 * num_classes labels for training
      # * 500 labels for validation
      # * 1000 labels for testing
  
      indices = []
      for i in range(num_classes):
          index = (data.y == i).nonzero().view(-1)
          index = index[torch.randperm(index.size(0))]
          indices.append(index)
  
      train_index = torch.cat([i[:20] for i in indices], dim=0)
  
      rest_index = torch.cat([i[20:] for i in indices], dim=0)
      rest_index = rest_index[torch.randperm(rest_index.size(0))]
  
      data.train_mask = index_to_mask(train_index, size=data.num_nodes)
      data.val_mask = index_to_mask(
          rest_index[:500], size=data.num_nodes
      )
      data.test_mask = index_to_mask(
          rest_index[500:1500], size=data.num_nodes
      )
  
      return data
  
file_path: pytorch_geometric/benchmark/citation/train_eval.py
imports: import time
  import torch
  import torch.nn.functional
  from torch import tensor
  from torch.optim import Adam
  from torch_geometric.profile import timeit, torch_profile
  from torch_geometric.utils import index_to_mask
label_desc: Use image node_id 1 for calling a global function with example usage: random_planetoid_splits(data, num_classes) and returns: data