code: def get_data(data, shogun_labels):
      """
      Creating features and labels from the data samples
      """
      num_samples = len(data)
      # considering the root label
      num_classes = len(shogun_labels) + 1
      labels = sg.MultilabelSOLabels(num_samples, num_classes)
  
      for i, data_sample in enumerate(data):
          feats, labs = get_data_sample(data_sample, shogun_labels)
          try:
              features = np.c_[features, feats]
          except NameError:
              features = feats
          labels.set_sparse_label(i, labs)
  
      return sg.create_features(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 3 for calling a global function with example usage: get_data(data, shogun_labels) and returns: sg,  labels