code: def to_one_hot(label, num_classes=10):
      vec = np.zeros(num_classes, dtype=np.float32)
      vec[label] = 1.0
      return vec
  
file_path: trax/trax/tf_numpy/examples/mnist/dataset.py
imports: import gzip
  import os
  import pickle
  import random
  import urllib
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: to_one_hot(label, num_classes) and returns: vec