code: def sklearn_multiclass_custom_objective(y_true, y_pred, weight=None):
      num_rows, num_class = y_pred.shape
      prob = softmax(y_pred)
      grad_update = np.zeros_like(prob)
      grad_update[np.arange(num_rows), y_true.astype(np.int32)] = -1.0
      grad = prob + grad_update
      factor = num_class / (num_class - 1)
      hess = factor * prob * (1 - prob)
      if weight is not None:
          weight2d = weight.reshape(-1, 1)
          grad *= weight2d
          hess *= weight2d
      return grad, hess
  
imports: import pickle
  from functools import lru_cache
  from inspect import getfullargspec
  import cloudpickle
  import joblib
  import numpy
  import sklearn.datasets
  from sklearn.utils import check_random_state
  import lightgbm
label_desc: Use image node_id 11 for calling a global function with example usage: sklearn_multiclass_custom_objective(y_true, y_pred, weight) and returns: grad,  hess