code: def generate_mask(num_nodes, index):
      """Generate different masks for train/validation/test dataset. For input `index`,
         the corresponding mask position will be set 1, otherwise 0.
  
      Args:
  
          num_nodes (int): Number of nodes in graph.
  
          index (numpy.ndarray): The index for train, validation or test dataset.
  
      Returns:
  
          mask (numpy.ndarray): Return masks for train/validation/test dataset.
  
      """
      mask = np.zeros(num_nodes, dtype=np.int64)
      mask[index] = 1
      return mask
  
file_path: PGL/apps/GNNAutoScale/utils.py
imports: import time
  import functools
  import numpy
  import paddle
  import pgl
  from pgl.utils.logger import log
label_desc: Use image node_id 2 for calling a global function with example usage: generate_mask(num_nodes, index) and returns: mask