code: def test_ndarray_onehot():
      shape = (100, 20)
      npy = np.arange(np.prod(shape)).reshape(shape)
      arr = mx.nd.array(npy)
      nrepeat = 3
      for repeat in range(nrepeat):
          indices = np.random.randint(shape[1], size=shape[0])
          npy[:] = 0.0
          npy[np.arange(shape[0]), indices] = 1.0
          mx.nd.onehot_encode(mx.nd.array(indices), out=arr)
          assert same(npy, arr.asnumpy())
  
imports: import os
  import mxnet
  import numpy
  import pickle
label_desc: Use image node_id 10 for calling a global function with example usage: test_ndarray_onehot() without return types