code: def get_data_sample(data_sample, shogun_labels):
      """
      Extracting features and labels from a single row of data
      """
      data = data_sample.split(",")
      features = np.array(data[:-1], dtype=np.float64)
      labs = data[-1].split("@")
      # adding the root label
      labels = np.zeros(len(labs) + 1, dtype=np.int32)
      labels[0] = 0
      for i, label in enumerate(labs):
          labels[i + 1] = shogun_labels[label]
      labels.sort()
  
      return features, labels
  
file_path: shogun/examples/undocumented/python/structure_hierarchical_multilabel_classification.py
imports: import shogun
  import numpy
  import time
label_desc: Use image node_id 2 for calling a global function with example usage: get_data_sample(data_sample, shogun_labels) and returns: features,  labels