code: def encode_y_to_arr(data, vocab2idx, max_seq_len):
      """
      Input:
          data: PyG graph object
          output: add y_arr to data
      """
  
      # PyG >= 1.5.0
      seq = data.y
  
      # PyG = 1.4.3
      # seq = data.y[0]
  
      data.y_arr = encode_seq_to_arr(seq, vocab2idx, max_seq_len)
  
      return data
  
file_path: ogb/examples/graphproppred/code2/utils.py
imports: import torch
  from collections import Counter
  import numpy
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: encode_y_to_arr(data, vocab2idx, max_seq_len) and returns: data