code: def dense_to_one_hot(labels_dense, num_classes=10):
      """Convert class labels from scalars to one-hot vectors."""
      num_labels = labels_dense.shape[0]
      index_offset = numpy.arange(num_labels) * num_classes
      labels_one_hot = numpy.zeros((num_labels, num_classes))
      labels_one_hot.flat[index_offset + labels_dense.ravel()] = 1
      return labels_one_hot
  
file_path: tflearn/tflearn/datasets/fashion_mnist.py
imports: from __future__ import print_function
  import gzip
  import os
  from six.moves import urllib
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: dense_to_one_hot(labels_dense, num_classes) and returns: labels_one_hot