code: def indices_to_one_hot(data, nb_classes):
      """Convert an iterable of indices to one-hot encoded labels.
  
      Parameters
      ----------
      data : list
          The raw data.
  
      nb_classes : int
          The number of targeted classes.
  
      Returns
      -------
  
      """
      targets = np.array(data).reshape(-1)
      return np.eye(nb_classes)[targets]
  
file_path: SUOD/suod/models/cost_predictor.py
imports: import sys
  import os
  import numpy
  import pandas
  from joblib import dump
  from scipy.stats import pearsonr
  from scipy.stats import spearmanr
  from sklearn.model_selection import train_test_split
  from sklearn.metrics import mean_squared_error
  from sklearn.metrics import r2_score
  from sklearn.ensemble import RandomForestRegressor
  import warnings
label_desc: Use image node_id 1 for calling a global function with example usage: indices_to_one_hot(data, nb_classes) and returns: np