code: def one_hot(length, index):
      """Return an nd array of given `length` filled with 0s and a 1 at `index`."""
      result = np.zeros(length)
      result[index] = 1
      return result
  
file_path: sonnet/sonnet/src/nets/dnc/util.py
imports: import numpy
  import tensorflow
  import tree
label_desc: Use image node_id 4 for calling a global function with example usage: one_hot(length, index) and returns: result