code: def prob_to_one_hot(y_pred):
      ret = np.zeros(y_pred.shape, np.bool_)
      indices = np.argmax(y_pred, axis=1)
      for i in range(y_pred.shape[0]):
          ret[i][indices[i]] = True
      return ret
  
file_path: dgl/examples/pytorch/grace/eval.py
imports: import functools
  import numpy
  from sklearn.linear_model import LogisticRegression
  from sklearn.metrics import f1_score
  from sklearn.model_selection import GridSearchCV, train_test_split
  from sklearn.multiclass import OneVsRestClassifier
  from sklearn.preprocessing import normalize, OneHotEncoder
label_desc: Use image node_id 2 for calling a global function with example usage: prob_to_one_hot(y_pred) and returns: ret