code: def roc_auc_score_universal(y_true, y_pred):
      """ROC AUC metric for both binary and multiclass classification.
  
      Parameters
      ----------
      y_true - 1d numpy array
          True class labels
      y_pred - 2d numpy array
          Predicted probabilities for each class
      """
      ohe = OneHotEncoder(sparse=False)
      y_true = ohe.fit_transform(y_true.reshape(-1, 1))
      # @@@@
      if len(y_pred.shape) == 1:
          y_pred = np.c_[y_pred, y_pred]
          y_pred[:, 0] = 1 - y_pred[:, 1]
      # @@@@
      auc_score = roc_auc_score(y_true, y_pred)
      return auc_score
  
imports: from __future__ import print_function
  from __future__ import division
  import unittest
  from numpy.testing import assert_array_equal
  from numpy.testing import assert_equal
  import numpy
  import scipy.stats
  from sklearn.model_selection import cross_val_predict
  from sklearn.model_selection import cross_val_score
  from sklearn.model_selection import StratifiedKFold
  from sklearn.datasets import make_classification
  from sklearn.preprocessing import OneHotEncoder
  from sklearn.metrics import accuracy_score
  from sklearn.metrics import zero_one_loss
  from sklearn.metrics import log_loss
  from sklearn.metrics import roc_auc_score
  from sklearn.metrics import make_scorer
  from sklearn.linear_model import LogisticRegression
  from sklearn.naive_bayes import GaussianNB
  from sklearn.dummy import DummyClassifier
  from vecstack import StackingTransformer
label_desc: Use image node_id 1 for calling a global function with example usage: roc_auc_score_universal(y_true, y_pred) and returns: auc_score