code: def partial_dependence(
      object, pred_data, xname, h2o_pp, pdp_name_idx
  ):
      x_pt = h2o_pp[pdp_name_idx][
          xname.lower()
      ]  # Needs to be lower case here as the PDP response sets everything to lower
      y_pt = list(range(len(x_pt)))
      y_sd = list(range(len(x_pt)))
      y_sem = list(range(len(x_pt)))
  
      for i in range(len(x_pt)):
          x_data = pred_data
          x_data[xname] = x_pt[i]
          pred = object.predict(x_data)["p1"]
          y_pt[i] = pred.mean()[0, 0]
          y_sd[i] = pred.sd()[0]
          y_sem[i] = y_sd[i] / math.sqrt(x_data.nrows)
  
      return y_pt, y_sd, y_sem
  
imports: import sys
  import h2o
  import math
  from tests import pyunit_utils
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
label_desc: Use image node_id 2 for calling a global function with example usage: partial_dependence(object, pred_data, xname, h2o_pp, pdp_name_idx) and returns: y_pt,  y_sd,  y_sem