code: def encode_label(label: np.array, nb_classes: int):
      """One-hot encoding of a single label
  
      :param label: class label (int or double without floating point digits)
      :param nb_classes: int, number of total classes
      :return: one-hot encoded vector
      """
      encoded = np.zeros(nb_classes)
      encoded[int(label)] = 1.0
      return encoded
  
file_path: elephas/elephas/utils/rdd_utils.py
imports: from pyspark import RDD, SparkContext
  from pyspark.mllib.regression import LabeledPoint
  import numpy
  from ..mllib.adapter import to_vector, from_vector
label_desc: Use image node_id 4 for calling a global function with example usage: encode_label(label, nb_classes) and returns: encoded