code: def _get_gradient(obj, pred, label, scale_pos_weight):
      p = obj.pred_transform(pred)
  
      # because we assume default behaviour for group weights this always equals to 1
      # ToDo: add handling for group weights case
      w = 1.0
  
      # group weights for positive class are scaled
      w_scaled = ivy.where(label == 1.0, w * scale_pos_weight, w)
  
      return ivy.hstack(
          [
              obj.first_order_gradient(p, label) * w_scaled,
              obj.second_order_gradient(p, label) * w_scaled,
          ]
      )
  
file_path: ivy/ivy/functional/frontends/xgboost/gbm/gbm.py
imports: import ivy
  from ivy.functional.frontends.xgboost.objective.regression_loss import LogisticRegression
  from ivy.functional.frontends.xgboost.linear.updater_coordinate import coordinate_updater
  from copy import deepcopy
label_desc: Use image node_id 1 for calling a global function with example usage: _get_gradient(obj, pred, label, scale_pos_weight) and returns: ivy